Commit Graph
12 Commits
Author SHA1 Message Date
Yunus Shaikh 8a9ab924f9 test(libressl): run EVP_aes_128_cbc through the EVP cipher calls
main's EVP_aes_128_cbc descriptor, the one CMAC uses, is a
LibreSslCipher, and this branch's EVP_EncryptInit_ex and
EVP_DecryptInit_ex take a LibreSslEvpCipher of the same layout, but no
test passed the one to the other. The new case does, with the
CBC-AES128 vectors of NIST SP 800-38A F.2.1 and F.2.2: encryption and
decryption without padding, and a round trip with PKCS#7 padding, in
chunks of 1, 7, 16 and 64 bytes. It covers code that already works, so
it has no red.
2026-11-03 07:01:24 -08:00
Yunus Shaikh ee78203513 test(libSceLibreSsl): stop requiring the cipher calls to throw on an ENGINE
The cipher context test required EVP_CIPHER_CTX_cleanup with an ENGINE
set, and EVP_EncryptInit_ex given one, to throw. ENGINE support isn't
implemented, and a test shouldn't lock that in, so both checks go. The
calls still refuse an ENGINE, as the debt entry says; the null-pointer,
malformed-context and invalid-length checks stay.
2026-11-01 03:20:42 +00:00
Yunus Shaikh 54f0e51486 fix(libSceLibreSsl): compare GCM tags in constant time
GcmFinish and the TLS decrypt path compared the computed tag with the
expected one through std::memcmp, which can stop at the first differing
byte and so show how much of a tag matches. Both now compare every byte
and fold the differences, as LibreSSL does with timingsafe_memcmp.

The tests now flip each byte of the tag in turn, for every GCM vector's
EVP_DecryptFinal_ex and for the TLS record decrypt, and require each one
to be rejected.
2026-11-01 03:20:07 +00:00
Yunus Shaikh ecdc56cf7f feat(libSceLibreSsl): implement EVP_cleanup 2026-11-01 03:20:07 +00:00
Yunus Shaikh 9a9e74e6f5 feat(libSceLibreSsl): implement the AES GCM EVP ciphers 2026-11-01 03:20:07 +00:00
Yunus Shaikh 2bf9387299 feat(libSceLibreSsl): implement the AES CFB8 and CTR EVP ciphers 2026-11-01 03:20:07 +00:00
Yunus Shaikh 0271de5852 feat(libSceLibreSsl): implement the EVP cipher Init, Update and Final calls 2026-11-01 03:20:07 +00:00
Yunus Shaikh 72e4fd7428 feat(libSceLibreSsl): implement EVP_CIPHER_CTX_cleanup, EVP_CIPHER_CTX_free and EVP_CIPHER_CTX_ctrl 2026-11-01 03:20:07 +00:00
Alvaro 16d0e81b02 refactor(libSceLibreSsl): declare the EVP_CIPHER_CTX exports in the public header 2026-11-01 03:32:25 +01:00
Alvaro 3caeefdaff feat(libSceLibreSsl): implement EVP_CIPHER_CTX_set_padding 2026-11-01 03:32:25 +01:00
Alvaro 4331785706 feat(libSceLibreSsl): implement EVP_CIPHER_CTX_new 2026-11-01 03:32:25 +01:00
Alvaro 40b8e7e5fa feat(libSceLibreSsl): implement EVP_CIPHER_CTX_init 2026-11-01 03:32:25 +01:00