Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F160492154
D42838.id130863.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
948 B
Referenced Files
None
Subscribers
None
D42838.id130863.diff
View Options
diff --git a/sys/crypto/openssl/amd64/ossl_aes_gcm.c b/sys/crypto/openssl/amd64/ossl_aes_gcm.c
--- a/sys/crypto/openssl/amd64/ossl_aes_gcm.c
+++ b/sys/crypto/openssl/amd64/ossl_aes_gcm.c
@@ -459,7 +459,7 @@
size_t bulk = 0, res;
int error;
- res = (AES_BLOCK_LEN - ctx->gcm.mres) % AES_BLOCK_LEN;
+ res = MIN(len, (AES_BLOCK_LEN - ctx->gcm.mres) % AES_BLOCK_LEN);
if ((error = gcm_encrypt(ctx, in, out, res)) != 0)
return error;
@@ -621,12 +621,12 @@
size_t bulk = 0, res;
int error;
- res = (AES_BLOCK_LEN - ctx->gcm.mres) % AES_BLOCK_LEN;
+ res = MIN(len, (AES_BLOCK_LEN - ctx->gcm.mres) % AES_BLOCK_LEN);
if ((error = gcm_decrypt(ctx, in, out, res)) != 0)
return error;
- bulk = aesni_gcm_decrypt(in, out, len, &ctx->aes_ks, ctx->gcm.Yi.c,
- ctx->gcm.Xi.u);
+ bulk = aesni_gcm_decrypt(in + res, out + res, len - res, &ctx->aes_ks,
+ ctx->gcm.Yi.c, ctx->gcm.Xi.u);
ctx->gcm.len.u[1] += bulk;
bulk += res;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Jun 26, 2:02 AM (6 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
34336148
Default Alt Text
D42838.id130863.diff (948 B)
Attached To
Mode
D42838: ossl: Fix some bugs in the fallback AES-GCM implementation
Attached
Detach File
Event Timeline
Log In to Comment