summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/engine/hw_cryptodev.c5
-rw-r--r--src/lib/libssl/src/crypto/engine/hw_cryptodev.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/libcrypto/engine/hw_cryptodev.c b/src/lib/libcrypto/engine/hw_cryptodev.c
index d3b186c132..a98f5d7e57 100644
--- a/src/lib/libcrypto/engine/hw_cryptodev.c
+++ b/src/lib/libcrypto/engine/hw_cryptodev.c
@@ -693,8 +693,9 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
693 693
694 viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp); 694 viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp);
695 695
696 if (ISUNALIGNED(out)) { 696 if (ISUNALIGNED(in) || ISUNALIGNED(out)) {
697 bcopy(spare, out, inl); 697 if (ISUNALIGNED(out))
698 bcopy(spare, out, inl);
698 free(spare); 699 free(spare);
699 } 700 }
700 701
diff --git a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
index d3b186c132..a98f5d7e57 100644
--- a/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/src/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -693,8 +693,9 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
693 693
694 viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp); 694 viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp);
695 695
696 if (ISUNALIGNED(out)) { 696 if (ISUNALIGNED(in) || ISUNALIGNED(out)) {
697 bcopy(spare, out, inl); 697 if (ISUNALIGNED(out))
698 bcopy(spare, out, inl);
698 free(spare); 699 free(spare);
699 } 700 }
700 701