summaryrefslogtreecommitdiff
path: root/libntp/a_md5encrypt.c
diff options
context:
space:
mode:
Diffstat (limited to 'libntp/a_md5encrypt.c')
-rw-r--r--libntp/a_md5encrypt.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/libntp/a_md5encrypt.c b/libntp/a_md5encrypt.c
index 7dc7e7ecf40dd..8c046f4e93c9a 100644
--- a/libntp/a_md5encrypt.c
+++ b/libntp/a_md5encrypt.c
@@ -12,12 +12,6 @@
#include "ntp_md5.h" /* provides OpenSSL digest API */
#include "isc/string.h"
-#ifdef OPENSSL
-# include "openssl/cmac.h"
-# define CMAC "AES128CMAC"
-# define AES_128_KEY_SIZE 16
-#endif
-
typedef struct {
const void * buf;
size_t len;
@@ -28,7 +22,7 @@ typedef struct {
size_t len;
} rwbuffT;
-#ifdef OPENSSL
+#if defined(OPENSSL) && defined(ENABLE_CMAC)
static size_t
cmac_ctx_size(
CMAC_CTX * ctx)
@@ -42,7 +36,7 @@ cmac_ctx_size(
}
return mlen;
}
-#endif /*OPENSSL*/
+#endif /*OPENSSL && ENABLE_CMAC*/
static size_t
make_mac(
@@ -63,6 +57,7 @@ make_mac(
INIT_SSL();
/* Check if CMAC key type specific code required */
+# ifdef ENABLE_CMAC
if (ktype == NID_cmac) {
CMAC_CTX * ctx = NULL;
void const * keyptr = key->buf;
@@ -100,7 +95,9 @@ make_mac(
if (ctx)
CMAC_CTX_cleanup(ctx);
}
- else { /* generic MAC handling */
+ else
+# endif /*ENABLE_CMAC*/
+ { /* generic MAC handling */
EVP_MD_CTX * ctx = EVP_MD_CTX_new();
u_int uilen = 0;
@@ -153,7 +150,7 @@ make_mac(
if (ktype == NID_md5)
{
EVP_MD_CTX * ctx = EVP_MD_CTX_new();
- uint uilen = 0;
+ u_int uilen = 0;
if (digest->len < 16) {
msyslog(LOG_ERR, "%s", "MAC encrypt: MAC md5 buf too small.");