X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fcrypto%2Fhmac_sha256%2Fhmac_sha256.c;fp=ccan%2Fcrypto%2Fhmac_sha256%2Fhmac_sha256.c;h=2238f9dc8fffbd4ee049ec8c965e0c11aeef37e2;hb=9e800830de8a9bbb9f103f120ea7de9220b6869d;hp=0392afe5c1127134e61e48d864dffe94252aeaa8;hpb=e46957c87a57ff2efd0b23e230599cce529f1f92;p=ccan diff --git a/ccan/crypto/hmac_sha256/hmac_sha256.c b/ccan/crypto/hmac_sha256/hmac_sha256.c index 0392afe5..2238f9dc 100644 --- a/ccan/crypto/hmac_sha256/hmac_sha256.c +++ b/ccan/crypto/hmac_sha256/hmac_sha256.c @@ -35,7 +35,8 @@ void hmac_sha256_init(struct hmac_sha256_ctx *ctx, * (e.g., if K is of length 20 bytes and B=64, then K will be * appended with 44 zero bytes 0x00) */ - memcpy(k_ipad, k, ksize); + if (ksize != 0) + memcpy(k_ipad, k, ksize); memset((char *)k_ipad + ksize, 0, HMAC_SHA256_BLOCKSIZE - ksize); /*