diff --git a/cyassl/ctaocrypt/asn.h b/cyassl/ctaocrypt/asn.h index bd8ad7111..4c25ebe0f 100644 --- a/cyassl/ctaocrypt/asn.h +++ b/cyassl/ctaocrypt/asn.h @@ -282,7 +282,7 @@ struct DecodedCert { #ifdef SHA_DIGEST_SIZE #define SIGNER_DIGEST_SIZE SHA_DIGEST_SIZE #else -#define SIGNER_DIGEST_SIZE 160 +#define SIGNER_DIGEST_SIZE 20 #endif /* CA Signers */ diff --git a/src/ssl.c b/src/ssl.c index ce053858d..2bb4e860c 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -882,10 +882,11 @@ Signer* GetCA(void* vp, byte* hash) if (cm == NULL) return NULL; - signers = cm->caList; if (LockMutex(&cm->caLock) != 0) return ret; + + signers = cm->caList; while (signers) { if (XMEMCMP(hash, signers->hash, SHA_DIGEST_SIZE) == 0) { ret = signers;