diff options
Diffstat (limited to 'lib/isc/hmacmd5.c')
-rw-r--r-- | lib/isc/hmacmd5.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/isc/hmacmd5.c b/lib/isc/hmacmd5.c index 6abe6e27df8e3..b26a336eadc09 100644 --- a/lib/isc/hmacmd5.c +++ b/lib/isc/hmacmd5.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004-2007, 2009, 2013, 2014 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 2000, 2001 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -28,6 +28,7 @@ #include <isc/hmacmd5.h> #include <isc/md5.h> #include <isc/platform.h> +#include <isc/safe.h> #include <isc/string.h> #include <isc/types.h> #include <isc/util.h> @@ -82,7 +83,7 @@ isc_hmacmd5_init(isc_hmacmd5_t *ctx, const unsigned char *key, isc_md5_update(&md5ctx, key, len); isc_md5_final(&md5ctx, ctx->key); } else - memcpy(ctx->key, key, len); + memmove(ctx->key, key, len); isc_md5_init(&ctx->md5ctx); memset(ipad, IPAD, sizeof(ipad)); @@ -145,5 +146,5 @@ isc_hmacmd5_verify2(isc_hmacmd5_t *ctx, unsigned char *digest, size_t len) { REQUIRE(len <= ISC_MD5_DIGESTLENGTH); isc_hmacmd5_sign(ctx, newdigest); - return (ISC_TF(memcmp(digest, newdigest, len) == 0)); + return (isc_safe_memcmp(digest, newdigest, len)); } |