Avoid hardcoded lengths. This fixes a bug in the HMAC-SHA224 tests.

This commit is contained in:
Dag-Erling Smørgrav 2014-07-11 15:09:59 +00:00 committed by des
parent 30c8e19de7
commit 18650540d8
5 changed files with 10 additions and 5 deletions

View file

@ -47,8 +47,9 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#define HMAC_SHA1_MAC_LEN 20
#define HMAC_SHA1_MAC_LEN SHA_DIGEST_LENGTH
static void
t_hmac_sha1_complete(const void *key, size_t keylen,

View file

@ -47,8 +47,9 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#define HMAC_SHA224_MAC_LEN 32
#define HMAC_SHA224_MAC_LEN SHA224_DIGEST_LENGTH
static void
t_hmac_sha224_complete(const void *key, size_t keylen,

View file

@ -47,8 +47,9 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#define HMAC_SHA256_MAC_LEN 32
#define HMAC_SHA256_MAC_LEN SHA256_DIGEST_LENGTH
static void
t_hmac_sha256_complete(const void *key, size_t keylen,

View file

@ -47,8 +47,9 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#define HMAC_SHA384_MAC_LEN 48
#define HMAC_SHA384_MAC_LEN SHA384_DIGEST_LENGTH
static void
t_hmac_sha384_complete(const void *key, size_t keylen,

View file

@ -47,8 +47,9 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/sha.h>
#define HMAC_SHA512_MAC_LEN 64
#define HMAC_SHA512_MAC_LEN SHA512_DIGEST_LENGTH
static void
t_hmac_sha512_complete(const void *key, size_t keylen,