expose EncodeSignature() for DER-encoded comparisons

This commit is contained in:
Chris Conlon
2014-11-07 16:33:38 -07:00
parent a45a8f2cd8
commit 71da84122f
3 changed files with 37 additions and 3 deletions

View File

@ -2894,6 +2894,39 @@ word32 EncodeSignature(byte* out, const byte* digest, word32 digSz, int hashOID)
}
int GetCTC_HashOID(int hashType)
{
switch (hashType) {
#ifdef CYASSL_MD2
case MD2:
return MD2h;
#endif
#ifndef NO_MD5
case MD5:
return MD5h;
#endif
#ifndef NO_SHA
case SHA:
return SHAh;
#endif
#ifndef NO_SHA256
case SHA256:
return SHA256h;
#endif
#ifdef CYASSL_SHA384
case SHA384:
return SHA384h;
#endif
#ifdef CYASSL_SHA512
case SHA512:
return SHA512h;
#endif
default:
return 0;
};
}
/* return true (1) or false (0) for Confirmation */
static int ConfirmSignature(const byte* buf, word32 bufSz,
const byte* key, word32 keySz, word32 keyOID,