summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libcrypto/engine/hw_cryptodev.c5
-rw-r--r--lib/libssl/src/crypto/engine/hw_cryptodev.c5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libcrypto/engine/hw_cryptodev.c b/lib/libcrypto/engine/hw_cryptodev.c
index d3b186c1324..a98f5d7e578 100644
--- a/lib/libcrypto/engine/hw_cryptodev.c
+++ b/lib/libcrypto/engine/hw_cryptodev.c
@@ -693,8 +693,9 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp);
- if (ISUNALIGNED(out)) {
- bcopy(spare, out, inl);
+ if (ISUNALIGNED(in) || ISUNALIGNED(out)) {
+ if (ISUNALIGNED(out))
+ bcopy(spare, out, inl);
free(spare);
}
diff --git a/lib/libssl/src/crypto/engine/hw_cryptodev.c b/lib/libssl/src/crypto/engine/hw_cryptodev.c
index d3b186c1324..a98f5d7e578 100644
--- a/lib/libssl/src/crypto/engine/hw_cryptodev.c
+++ b/lib/libssl/src/crypto/engine/hw_cryptodev.c
@@ -693,8 +693,9 @@ xcrypt_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out,
viac3_xcrypt_cbc(cw, usein, useout, ctx->cipher_data, inl / 16, ivp);
- if (ISUNALIGNED(out)) {
- bcopy(spare, out, inl);
+ if (ISUNALIGNED(in) || ISUNALIGNED(out)) {
+ if (ISUNALIGNED(out))
+ bcopy(spare, out, inl);
free(spare);
}