Skip to content

Commit

Permalink
changed err code to a generic openssl reader exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kartheekp-ms committed May 21, 2020
1 parent cfe8d60 commit afcb429
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ internal static class CertificateProvider

private const int MACOS_INVALID_CERT = -25257;

// OpenSSL: error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error
private const int OPENSSL_ERR_R_NESTED_ASN1_ERROR = 0x0D07803A;
// error:0x80131501 generic exception raised by dotnet before using OpenSSL
private const int OPENSSL_READER_ASN1_ERROR = unchecked((int)0x80131501);

/// <summary>
/// Looks for X509Certificates using the CertificateSourceOptions.
Expand Down Expand Up @@ -77,7 +77,7 @@ public static async Task<X509Certificate2Collection> GetCertificatesAsync(Certif
options.CertificatePath)));

case CRYPT_E_NO_MATCH_HRESULT:
case OPENSSL_ERR_R_NESTED_ASN1_ERROR:
case OPENSSL_READER_ASN1_ERROR:
case MACOS_INVALID_CERT:
throw new SignCommandException(
LogMessage.CreateError(NuGetLogCode.NU3001,
Expand Down

0 comments on commit afcb429

Please sign in to comment.