Skip to content

Commit 1fb92aa

Browse files
authored
Add missing goto for checking encapsulation invariants.
When we encapsulate something with ML-KEM on OpenSSL, we were checking that the amount written is what we expected, but a missing `goto` caused it to be marked as a success. This isn't really a reliability problem since we already know how much encapsulation sizes are, we're just making sure OpenSSL and the managed side agree on it.
1 parent 2e20682 commit 1fb92aa

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/native/libs/System.Security.Cryptography.Native/pal_evp_kem.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ int32_t CryptoNative_EvpKemEncapsulate(EVP_PKEY* pKey,
187187
sharedSecretLengthT != Int32ToSizeT(sharedSecretLength))
188188
{
189189
ret = -1;
190+
goto done;
190191
}
191192

192193
ret = 1;

0 commit comments

Comments
 (0)