Skip to content

Commit

Permalink
Correct padding mode flag name for EVP_PKEY_decrypt/encrypt() examples
Browse files Browse the repository at this point in the history
The example code in EVP_PKEY_decrypt(3) and EVP_PKEY_encrypt(3) and uses
a nonexistent padding mode `RSA_OAEP_PADDING`, which should be
`RSA_PKCS1_OAEP_PADDING` instead.

CLA: trivial

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #18255)
  • Loading branch information
dimitry-unified-streaming authored and paulidale committed May 9, 2022
1 parent be92036 commit ecb1ed1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/man3/EVP_PKEY_decrypt.pod
Expand Up @@ -71,7 +71,7 @@ Decrypt data using OAEP (for RSA keys):
/* Error occurred */
if (EVP_PKEY_decrypt_init(ctx) <= 0)
/* Error */
if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_OAEP_PADDING) <= 0)
if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_OAEP_PADDING) <= 0)
/* Error */

/* Determine buffer length */
Expand Down
2 changes: 1 addition & 1 deletion doc/man3/EVP_PKEY_encrypt.pod
Expand Up @@ -74,7 +74,7 @@ set 'eng = NULL;' to start with the default OpenSSL RSA implementation:
/* Error occurred */
if (EVP_PKEY_encrypt_init(ctx) <= 0)
/* Error */
if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_OAEP_PADDING) <= 0)
if (EVP_PKEY_CTX_set_rsa_padding(ctx, RSA_PKCS1_OAEP_PADDING) <= 0)
/* Error */

/* Determine buffer length */
Expand Down

0 comments on commit ecb1ed1

Please sign in to comment.