crypto: forward auth tag to OpenSSL immediately · nodejs/node@cec9d9d · GitHub
Skip to content

Commit cec9d9d

Browse files
tniessentargos
authored andcommitted
crypto: forward auth tag to OpenSSL immediately
This change simplifies the AEAD implementation. Instead of storing the authentication tag when the user calls `setAuthTag()` and passing it to OpenSSL later in `MaybePassAuthTagToOpenSSL()`, the modified code forwards it to OpenSSL from within `setAuthTag()` already, removing the need to store it. For clarity, I have also renamed the possible `AuthTagState` values to better reflect the actual state of the authentication tag. I assume that we did not originally do this due to issues with some old versions of OpenSSL when reordering certain function calls, but even with the recent additions I made to the relevant test (namely, 1ef9923 and 53944c4), it seems to pass in both OpenSSL 3 and OpenSSL 1.1.1 with this simplification. PR-URL: #58547 Reviewed-By: Filip Skokan <panva.ip@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 34e86f9 commit cec9d9d

2 files changed

Lines changed: 16 additions & 43 deletions

File tree

src/crypto/crypto_cipher.cc

Lines changed: 12 additions & 37 deletions

src/crypto/crypto_cipher.h

Lines changed: 4 additions & 6 deletions

0 commit comments

Comments
 (0)