Page MenuHomeFreeBSD

D42783.id130630.diff
No OneTemporary

D42783.id130630.diff

diff --git a/sys/crypto/openssl/ossl_aes.c b/sys/crypto/openssl/ossl_aes.c
--- a/sys/crypto/openssl/ossl_aes.c
+++ b/sys/crypto/openssl/ossl_aes.c
@@ -167,7 +167,7 @@
ossl_aes_gcm(struct ossl_session_cipher *s, struct cryptop *crp,
const struct crypto_session_params *csp)
{
- struct ossl_cipher_context key;
+ struct ossl_cipher_context state;
struct crypto_buffer_cursor cc_in, cc_out;
unsigned char iv[AES_BLOCK_LEN], tag[AES_BLOCK_LEN];
struct ossl_gcm_context *ctx;
@@ -182,18 +182,18 @@
if (crp->crp_cipher_key != NULL) {
if (encrypt)
error = s->cipher->set_encrypt_key(crp->crp_cipher_key,
- 8 * csp->csp_cipher_klen, &key);
+ 8 * csp->csp_cipher_klen, &state);
else
error = s->cipher->set_decrypt_key(crp->crp_cipher_key,
- 8 * csp->csp_cipher_klen, &key);
+ 8 * csp->csp_cipher_klen, &state);
if (error)
return (error);
- ctx = (struct ossl_gcm_context *)&key;
} else if (encrypt) {
- ctx = (struct ossl_gcm_context *)&s->enc_ctx;
+ memcpy(&state, &s->enc_ctx, sizeof(struct ossl_gcm_context));
} else {
- ctx = (struct ossl_gcm_context *)&s->dec_ctx;
+ memcpy(&state, &s->dec_ctx, sizeof(struct ossl_gcm_context));
}
+ ctx = (struct ossl_gcm_context *)&state;
crypto_read_iv(crp, iv);
ctx->ops->setiv(ctx, iv, csp->csp_ivlen);

File Metadata

Mime Type
text/plain
Expires
Sun, Jul 19, 6:17 PM (14 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
35243773
Default Alt Text
D42783.id130630.diff (1 KB)

Event Timeline