summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2022-05-06 10:10:10 +0000
committertb <>2022-05-06 10:10:10 +0000
commit06c2b32025e69d4ed54a0d0d934387a6f5088af9 (patch)
tree45d68143869bce7abe050a8b305f66542bd62b7f /src/lib
parent9d1190711bcfaa72dfafc324971b6b12d5032583 (diff)
downloadopenbsd-06c2b32025e69d4ed54a0d0d934387a6f5088af9.tar.gz
openbsd-06c2b32025e69d4ed54a0d0d934387a6f5088af9.tar.bz2
openbsd-06c2b32025e69d4ed54a0d0d934387a6f5088af9.zip
Also check EVP_PKEY_CTX_new_id() return in example code. Letting this
be caught by the error check of EVP_PKEY_derive_init() is a dubious pattern.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.36
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3 b/src/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3
index 36e34f3c27..559c68bd6e 100644
--- a/src/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3
+++ b/src/lib/libcrypto/man/EVP_PKEY_CTX_set_hkdf_md.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: EVP_PKEY_CTX_set_hkdf_md.3,v 1.1 2022/05/06 07:36:54 tb Exp $ 1.\" $OpenBSD: EVP_PKEY_CTX_set_hkdf_md.3,v 1.2 2022/05/06 10:10:10 tb Exp $
2.\" full merge up to: OpenSSL 1cb7eff4 Sep 10 13:56:40 2019 +0100 2.\" full merge up to: OpenSSL 1cb7eff4 Sep 10 13:56:40 2019 +0100
3.\" 3.\"
4.\" This file was written by Alessandro Ghedini <alessandro@ghedini.me>, 4.\" This file was written by Alessandro Ghedini <alessandro@ghedini.me>,
@@ -217,7 +217,9 @@ This example derives 10 bytes using SHA-256 with the secret key
217EVP_PKEY_CTX *pctx; 217EVP_PKEY_CTX *pctx;
218unsigned char out[10]; 218unsigned char out[10];
219size_t outlen = sizeof(out); 219size_t outlen = sizeof(out);
220pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL); 220
221if ((pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_HKDF, NULL)) == NULL)
222 /* Error */
221 223
222if (EVP_PKEY_derive_init(pctx) <= 0) 224if (EVP_PKEY_derive_init(pctx) <= 0)
223 /* Error */ 225 /* Error */