[gnutls-devel] GnuTLS | Support RSA-OAEP (!1805)
Read-only notification of GnuTLS library development activities
gnutls-devel at lists.gnutls.org
Sat Mar 2 09:46:57 CET 2024
Daiki Ueno commented on a discussion on lib/nettle/pk.c: https://gitlab.com/gnutls/gnutls/-/merge_requests/1805#note_1797972732
> - ret = rsa_encrypt(&pub, NULL, random_func, plaintext->size,
> - plaintext->data, p);
> - if (ret == 0 || HAVE_LIB_ERROR()) {
> - ret = gnutls_assert_val(GNUTLS_E_ENCRYPTION_FAILED);
> +
> + ciphertext->data = gnutls_malloc(pub.size);
> + if (!ciphertext->data) {
> + ret = gnutls_assert_val(GNUTLS_E_MEMORY_ERROR);
> goto cleanup;
> }
> + ciphertext->size = pub.size;
> +
> + ret = _rsa_encrypt(&pub, NULL, random_func, plaintext->size,
> + plaintext->data, ciphertext->data);
> + if (ret < 0) {
> + gnutls_assert();
Thanks for pointing that out; I've rewritten that part using a temporary buffer which is always freed at the `cleanup` label.
--
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/merge_requests/1805#note_1797972732
You're receiving this email because of your account on gitlab.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20240302/7a3f7a74/attachment-0001.html>
More information about the Gnutls-devel
mailing list