centralizing MAX_DIGEST_SIZE definition in hmac.h

This commit is contained in:
Moisés Guimarães
2013-09-06 15:53:22 -03:00
parent f2c75a9e87
commit d7a08b1a76
5 changed files with 13 additions and 27 deletions

View File

@@ -98,7 +98,7 @@ typedef enum {
} processReply;
#ifndef NO_OLD_TLS
static void Hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
static void SSL_hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
int content, int verify);
#endif
@@ -1416,7 +1416,7 @@ int InitSSL(CYASSL* ssl, CYASSL_CTX* ctx)
ssl->options.resuming = 0;
ssl->options.haveSessionId = 0;
#ifndef NO_OLD_TLS
ssl->hmac = Hmac; /* default to SSLv3 */
ssl->hmac = SSL_hmac; /* default to SSLv3 */
#else
ssl->hmac = TLS_hmac;
#endif
@@ -3422,7 +3422,7 @@ static int DoHelloRequest(CYASSL* ssl, const byte* input, word32* inOutIdx)
const byte* mac;
int padSz = ssl->keys.encryptSz - HANDSHAKE_HEADER_SZ -
ssl->specs.hash_size;
byte verify[SHA256_DIGEST_SIZE];
byte verify[MAX_DIGEST_SIZE];
ssl->hmac(ssl, verify, input + *inOutIdx - HANDSHAKE_HEADER_SZ,
HANDSHAKE_HEADER_SZ, handshake, 1);
@@ -4954,7 +4954,7 @@ int SendChangeCipher(CYASSL* ssl)
#ifndef NO_OLD_TLS
static void Hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
static void SSL_hmac(CYASSL* ssl, byte* digest, const byte* in, word32 sz,
int content, int verify)
{
byte result[MAX_DIGEST_SIZE];