mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-04 05:04:41 +02:00
certs still use SHA hash for names
This commit is contained in:
@@ -1436,9 +1436,7 @@ static int GetKey(DecodedCert* cert)
|
||||
/* process NAME, either issuer or subject */
|
||||
static int GetName(DecodedCert* cert, int nameType)
|
||||
{
|
||||
#ifndef NO_SHA
|
||||
Sha sha;
|
||||
#endif
|
||||
Sha sha; /* MUST have SHA-1 hash for cert names */
|
||||
int length; /* length of all distinguished names */
|
||||
int dummy;
|
||||
char* full = (nameType == ISSUER) ? cert->issuer : cert->subject;
|
||||
@@ -1463,14 +1461,12 @@ static int GetName(DecodedCert* cert, int nameType)
|
||||
if (GetSequence(cert->source, &cert->srcIdx, &length, cert->maxIdx) < 0)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
#ifndef NO_SHA
|
||||
InitSha(&sha);
|
||||
ShaUpdate(&sha, &cert->source[idx], length + cert->srcIdx - idx);
|
||||
if (nameType == ISSUER)
|
||||
ShaFinal(&sha, cert->issuerHash);
|
||||
else
|
||||
ShaFinal(&sha, cert->subjectHash);
|
||||
#endif
|
||||
|
||||
length += cert->srcIdx;
|
||||
idx = 0;
|
||||
|
Reference in New Issue
Block a user