Skip to content

Commit

Permalink
Update cipher.go
Browse files Browse the repository at this point in the history
Co-authored-by: Davis Goodin <[email protected]>
  • Loading branch information
qmuntal and dagood authored Sep 14, 2023
1 parent 2ebd923 commit bc4ab9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cipher.go
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,8 @@ func newCipherCtx(kind cipherKind, mode cipherMode, encrypt cipherOp, key, iv []
if C.go_openssl_EVP_CIPHER_CTX_set_key_length(ctx, C.int(len(key))) != 1 {
return nil, newOpenSSLError("EVP_CIPHER_CTX_set_key_length")
}
cipher = nil // don't reset the cipher
// Pass nil to the next call to EVP_CipherInit_ex to avoid resetting ctx's cipher.
cipher = nil
}
if C.go_openssl_EVP_CipherInit_ex(ctx, cipher, nil, base(key), base(iv), C.int(encrypt)) != 1 {
return nil, fail("unable to initialize EVP cipher ctx")
Expand Down

0 comments on commit bc4ab9f

Please sign in to comment.