Fix examples in EVP_PKEY_encapsulate/decapsulate documentation

Fixes #25448

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25450)
This commit is contained in:
Зишан Мирза 2024-09-12 16:01:21 +02:00 committed by Tomas Mraz
parent ffc5a29608
commit 4f899849ce
2 changed files with 2 additions and 2 deletions

View File

@ -64,7 +64,7 @@ Decapsulate data using RSA:
unsigned char *secret = NULL;;
ctx = EVP_PKEY_CTX_new_from_pkey(libctx, rsa_priv_key, NULL);
if (ctx = NULL)
if (ctx == NULL)
/* Error */
if (EVP_PKEY_decapsulate_init(ctx, NULL) <= 0)
/* Error */

View File

@ -70,7 +70,7 @@ Encapsulate an RSASVE key (for RSA keys).
unsigned char *out = NULL, *secret = NULL;
ctx = EVP_PKEY_CTX_new_from_pkey(libctx, rsa_pub_key, NULL);
if (ctx = NULL)
if (ctx == NULL)
/* Error */
if (EVP_PKEY_encapsulate_init(ctx, NULL) <= 0)
/* Error */