Commit 718e9dce authored by Michael Müller's avatar Michael Müller Committed by Alexandre Julliard

crypt32: Implement decoding of X509_ECC_SIGNATURE.

parent d791d36a
...@@ -6013,6 +6013,35 @@ static BOOL WINAPI CRYPT_AsnDecodeObjectIdentifier(DWORD dwCertEncodingType, ...@@ -6013,6 +6013,35 @@ static BOOL WINAPI CRYPT_AsnDecodeObjectIdentifier(DWORD dwCertEncodingType,
return ret; return ret;
} }
static BOOL WINAPI CRYPT_AsnDecodeEccSignature(DWORD dwCertEncodingType,
LPCSTR lpszStructType, const BYTE *pbEncoded, DWORD cbEncoded, DWORD dwFlags,
CRYPT_DECODE_PARA *pDecodePara, void *pvStructInfo, DWORD *pcbStructInfo)
{
BOOL ret;
struct AsnDecodeSequenceItem items[] = {
{ ASN_INTEGER, offsetof(CERT_ECC_SIGNATURE, r),
CRYPT_AsnDecodeUnsignedIntegerInternal, sizeof(CRYPT_UINT_BLOB), FALSE,
TRUE, offsetof(CERT_ECC_SIGNATURE, r.pbData), 0 },
{ ASN_INTEGER, offsetof(CERT_ECC_SIGNATURE, s),
CRYPT_AsnDecodeUnsignedIntegerInternal, sizeof(CRYPT_UINT_BLOB), FALSE,
TRUE, offsetof(CERT_ECC_SIGNATURE, s.pbData), 0 },
};
__TRY
{
ret = CRYPT_AsnDecodeSequence(items, ARRAY_SIZE(items),
pbEncoded, cbEncoded, dwFlags, pDecodePara, pvStructInfo,
pcbStructInfo, NULL, NULL);
}
__EXCEPT_PAGE_FAULT
{
SetLastError(STATUS_ACCESS_VIOLATION);
ret = FALSE;
}
__ENDTRY
return ret;
}
static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
LPCSTR lpszStructType) LPCSTR lpszStructType)
{ {
...@@ -6155,6 +6184,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType, ...@@ -6155,6 +6184,9 @@ static CryptDecodeObjectExFunc CRYPT_GetBuiltinDecoder(DWORD dwCertEncodingType,
case LOWORD(X509_OBJECT_IDENTIFIER): case LOWORD(X509_OBJECT_IDENTIFIER):
decodeFunc = CRYPT_AsnDecodeObjectIdentifier; decodeFunc = CRYPT_AsnDecodeObjectIdentifier;
break; break;
case LOWORD(X509_ECC_SIGNATURE):
decodeFunc = CRYPT_AsnDecodeEccSignature;
break;
} }
} }
else if (!strcmp(lpszStructType, szOID_CERT_EXTENSIONS)) else if (!strcmp(lpszStructType, szOID_CERT_EXTENSIONS))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment