mirror of https://github.com/wolfSSL/wolfssl
certs still use SHA hash for names
This commit is contained in:
parent
30553a43ed
commit
7004b2eafc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue