mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 20:54:41 +02:00
fix Signer hash size w/o SHA, fix GetCA caList b4 lock
This commit is contained in:
@@ -282,7 +282,7 @@ struct DecodedCert {
|
|||||||
#ifdef SHA_DIGEST_SIZE
|
#ifdef SHA_DIGEST_SIZE
|
||||||
#define SIGNER_DIGEST_SIZE SHA_DIGEST_SIZE
|
#define SIGNER_DIGEST_SIZE SHA_DIGEST_SIZE
|
||||||
#else
|
#else
|
||||||
#define SIGNER_DIGEST_SIZE 160
|
#define SIGNER_DIGEST_SIZE 20
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* CA Signers */
|
/* CA Signers */
|
||||||
|
@@ -882,10 +882,11 @@ Signer* GetCA(void* vp, byte* hash)
|
|||||||
if (cm == NULL)
|
if (cm == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
signers = cm->caList;
|
|
||||||
|
|
||||||
if (LockMutex(&cm->caLock) != 0)
|
if (LockMutex(&cm->caLock) != 0)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
signers = cm->caList;
|
||||||
while (signers) {
|
while (signers) {
|
||||||
if (XMEMCMP(hash, signers->hash, SHA_DIGEST_SIZE) == 0) {
|
if (XMEMCMP(hash, signers->hash, SHA_DIGEST_SIZE) == 0) {
|
||||||
ret = signers;
|
ret = signers;
|
||||||
|
Reference in New Issue
Block a user