Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PSPKI 3.7.2 - Get-CertificateRequest - Input data does not represent valid 'OBJECT_IDENTIFIER' type. #139

Closed
ckrueger1979 opened this issue Feb 9, 2021 · 9 comments
Labels
bug Bug. An issue exist in our code. fixed-vNext The item is fixed in development code. Will be available in next release.

Comments

@ckrueger1979
Copy link

ckrueger1979 commented Feb 9, 2021

Hi,

I get the following error while trying to read a certificate request with Get-CertificateRequest

`
PS C:> New-Object Security.Cryptography.X509CertificateRequests.X509CertificateRequest -ArgumentList C:\certs\mycsr.csr
$error[0].Exception.InnerException.psbase
$error[0].Exception.InnerException.StackTrace
New-Object : Ausnahme beim Aufrufen von ".ctor" mit 1 Argument(en): "Input data does not represent valid 'OBJECT_IDENTIFIER' type."
In Zeile:1 Zeichen:1

  • New-Object Security.Cryptography.X509CertificateRequests.X509Certific ...
  •   + CategoryInfo          : InvalidOperation: (:) [New-Object], MethodInvocationException
      + FullyQualifiedErrorId : ConstructorInvokedThrowException,Microsoft.PowerShell.Commands.NewObjectCommand
    
    
    
    

Offset : 0
Message : Input data does not represent valid 'OBJECT_IDENTIFIER' type.
Data : {}
InnerException :
TargetSite : Void .ctor(SysadminsLV.Asn1Parser.Asn1Reader)
StackTrace : bei SysadminsLV.Asn1Parser.Universal.Asn1ObjectIdentifier..ctor(Asn1Reader asn)
bei SysadminsLV.PKI.Cryptography.Pkcs.SignedPkcs7`1.DecodeCms(Asn1Reader asn)
bei System.Security.Cryptography.X509CertificateRequests.X509CertificateRequest.m_initialize()
HelpLink :
Source : SysadminsLV.Asn1Parser
HResult : -2146881269

bei SysadminsLV.Asn1Parser.Universal.Asn1ObjectIdentifier..ctor(Asn1Reader asn)
bei SysadminsLV.PKI.Cryptography.Pkcs.SignedPkcs71.DecodeCms(Asn1Reader asn) bei System.Security.Cryptography.X509CertificateRequests.X509CertificateRequest.m_initialize()

@ckrueger1979
Copy link
Author

PS: csr is valid according to
.\openssl.exe req -text -noout -verify -in

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 9, 2021

can you send me your CSR? You can send it through contact form: https://www.sysadmins.lv/contact.aspx

@ckrueger1979
Copy link
Author

Send as requested

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 9, 2021

thanks, received. I will investigate this.

@ckrueger1979
Copy link
Author

Maybe I found the error myself.
One of the subject alternative names is bogus. It begins with a "."

@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 9, 2021

No, the problem is somewhere else. Your request is PKCS10, however the code incorrectly detects it as PKCS7 and attempts to unroll PKCS7 syntax.

@Crypt32 Crypt32 added the bug Bug. An issue exist in our code. label Feb 9, 2021
Crypt32 pushed a commit to PKISolutions/pkix.net that referenced this issue Feb 9, 2021
@Crypt32
Copy link
Collaborator

Crypt32 commented Feb 9, 2021

Maybe I found the error myself.
One of the subject alternative names is bogus. It begins with a "."

yeah, you were right. The problem was with leading dot. While this syntax it is not valid name for Subject Alternative Names extension, it is valid for Name Constraints extension. I've fixed this in dev branch and fix will be released in next PSPKI version.

@Crypt32 Crypt32 added the fixed-vNext The item is fixed in development code. Will be available in next release. label Feb 9, 2021
@ckrueger1979
Copy link
Author

Thank you very much.

@Crypt32
Copy link
Collaborator

Crypt32 commented Jun 15, 2023

Fixed in v4.0.0

@Crypt32 Crypt32 closed this as completed Jun 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug. An issue exist in our code. fixed-vNext The item is fixed in development code. Will be available in next release.
Projects
None yet
Development

No branches or pull requests

2 participants