diff --git a/lib/crypto_backend/crypto_cipher_kernel.c b/lib/crypto_backend/crypto_cipher_kernel.c index 77b3643f..50b00317 100644 --- a/lib/crypto_backend/crypto_cipher_kernel.c +++ b/lib/crypto_backend/crypto_cipher_kernel.c @@ -164,7 +164,7 @@ static int _crypt_cipher_crypt(struct crypt_cipher_kernel *ctx, header->cmsg_len = iv_msg_size; alg_iv = (void*)CMSG_DATA(header); alg_iv->ivlen = iv_length; - memcpy(alg_iv->iv, iv, iv_length); + crypt_backend_memcpy(alg_iv->iv, iv, iv_length); } len = sendmsg(ctx->opfd, &msg, 0); diff --git a/lib/crypto_backend/crypto_gcrypt.c b/lib/crypto_backend/crypto_gcrypt.c index 8e3f14e4..5b12088e 100644 --- a/lib/crypto_backend/crypto_gcrypt.c +++ b/lib/crypto_backend/crypto_gcrypt.c @@ -263,7 +263,7 @@ int crypt_hash_final(struct crypt_hash *ctx, char *buffer, size_t length) if (!hash) return -EINVAL; - memcpy(buffer, hash, length); + crypt_backend_memcpy(buffer, hash, length); crypt_hash_restart(ctx); return 0; @@ -337,7 +337,7 @@ int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length) if (!hash) return -EINVAL; - memcpy(buffer, hash, length); + crypt_backend_memcpy(buffer, hash, length); crypt_hmac_restart(ctx); return 0; diff --git a/lib/crypto_backend/crypto_nettle.c b/lib/crypto_backend/crypto_nettle.c index f08db748..837fed8d 100644 --- a/lib/crypto_backend/crypto_nettle.c +++ b/lib/crypto_backend/crypto_nettle.c @@ -313,7 +313,7 @@ int crypt_hmac_init(struct crypt_hmac **ctx, const char *name, return -ENOMEM; } - memcpy(h->key, key, key_length); + crypt_backend_memcpy(h->key, key, key_length); h->key_length = key_length; h->hash->init(&h->nettle_ctx); diff --git a/lib/crypto_backend/crypto_nss.c b/lib/crypto_backend/crypto_nss.c index 6b390a4a..e394d16c 100644 --- a/lib/crypto_backend/crypto_nss.c +++ b/lib/crypto_backend/crypto_nss.c @@ -177,7 +177,7 @@ int crypt_hash_final(struct crypt_hash *ctx, char *buffer, size_t length) if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess) return -EINVAL; - memcpy(buffer, tmp, length); + crypt_backend_memcpy(buffer, tmp, length); crypt_backend_memzero(tmp, sizeof(tmp)); if (tmp_len < length) @@ -278,7 +278,7 @@ int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length) if (PK11_DigestFinal(ctx->md, tmp, &tmp_len, length) != SECSuccess) return -EINVAL; - memcpy(buffer, tmp, length); + crypt_backend_memcpy(buffer, tmp, length); crypt_backend_memzero(tmp, sizeof(tmp)); if (tmp_len < length) diff --git a/lib/crypto_backend/crypto_openssl.c b/lib/crypto_backend/crypto_openssl.c index 4e853844..8276d561 100644 --- a/lib/crypto_backend/crypto_openssl.c +++ b/lib/crypto_backend/crypto_openssl.c @@ -402,7 +402,7 @@ int crypt_hash_final(struct crypt_hash *ctx, char *buffer, size_t length) if (EVP_DigestFinal_ex(ctx->md, tmp, &tmp_len) != 1) return -EINVAL; - memcpy(buffer, tmp, length); + crypt_backend_memcpy(buffer, tmp, length); crypt_backend_memzero(tmp, sizeof(tmp)); if (tmp_len < length) @@ -531,7 +531,7 @@ int crypt_hmac_final(struct crypt_hmac *ctx, char *buffer, size_t length) HMAC_Final(ctx->md, tmp, &tmp_len); #endif - memcpy(buffer, tmp, length); + crypt_backend_memcpy(buffer, tmp, length); crypt_backend_memzero(tmp, sizeof(tmp)); if (tmp_len < length)