sha256 with ECDSA certificate signatures

This commit is contained in:
Todd A Ouska
2011-04-08 11:08:45 -07:00
parent 214d2cfad7
commit 0c6015fb86
2 changed files with 5 additions and 3 deletions

View File

@@ -126,7 +126,8 @@ enum Sig_Sum {
MD5wRSA = 648, MD5wRSA = 648,
SHAwRSA = 649, SHAwRSA = 649,
SHAwECDSA = 520, SHAwECDSA = 520,
SHA256wRSA = 655 SHA256wRSA = 655,
SHA256wECDSA = 524
}; };
enum Hash_Sum { enum Hash_Sum {

View File

@@ -1583,7 +1583,7 @@ static int ConfirmSignature(DecodedCert* cert, const byte* key, word32 keySz,
#ifndef NO_SHA256 #ifndef NO_SHA256
byte digest[SHA256_DIGEST_SIZE]; /* max size */ byte digest[SHA256_DIGEST_SIZE]; /* max size */
#else #else
byte digest[SHA_DIGEST_SIZE]; /* max size */ byte digest[SHA_DIGEST_SIZE]; /* max size */
#endif #endif
int hashType, digestSz, ret; int hashType, digestSz, ret;
@@ -1607,7 +1607,8 @@ static int ConfirmSignature(DecodedCert* cert, const byte* key, word32 keySz,
digestSz = SHA_DIGEST_SIZE; digestSz = SHA_DIGEST_SIZE;
} }
#ifndef NO_SHA256 #ifndef NO_SHA256
else if (cert->signatureOID == SHA256wRSA) { else if (cert->signatureOID == SHA256wRSA ||
cert->signatureOID == SHA256wECDSA) {
Sha256 sha256; Sha256 sha256;
InitSha256(&sha256); InitSha256(&sha256);
Sha256Update(&sha256, cert->source + cert->certBegin, Sha256Update(&sha256, cert->source + cert->certBegin,