diff options
author | tb <> | 2022-01-09 15:15:25 +0000 |
---|---|---|
committer | tb <> | 2022-01-09 15:15:25 +0000 |
commit | 12dd2352d38b1ef2237d623bc6b869d169e71567 (patch) | |
tree | b42edbe525fc7c43874d4c14d0981bb1cb4e2d3d /src/lib/libcrypto/evp/evp.h | |
parent | 98fb653e64884887dde11a1e705e45a6290548d1 (diff) | |
download | openbsd-12dd2352d38b1ef2237d623bc6b869d169e71567.tar.gz openbsd-12dd2352d38b1ef2237d623bc6b869d169e71567.tar.bz2 openbsd-12dd2352d38b1ef2237d623bc6b869d169e71567.zip |
Prepare to provide EVP_MD_CTX{,_set}_pkey_ctx()
This API with very strange ownership handling is used by Ruby 3.1,
unfortunately.
For unclear reasons, it was decided that the caller retains ownership of
the pctx passed in. EVP_PKEY_CTX aren't refcounted, so a flag was added to
make sure that md_ctx->pctx is not freed in EVP_MD_CTX_{cleanup,reset}().
Since EVP_MD_CTX_copy_ex() duplicates the md_ctx->pctx, the flag also needs
to be unset on the duplicated EVP_MD_CTX.
ok inoguchi jsing
Diffstat (limited to 'src/lib/libcrypto/evp/evp.h')
-rw-r--r-- | src/lib/libcrypto/evp/evp.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/lib/libcrypto/evp/evp.h b/src/lib/libcrypto/evp/evp.h index b5afa477da..aa5b35f67c 100644 --- a/src/lib/libcrypto/evp/evp.h +++ b/src/lib/libcrypto/evp/evp.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp.h,v 1.91 2022/01/07 21:58:17 tb Exp $ */ | 1 | /* $OpenBSD: evp.h,v 1.92 2022/01/09 15:15:25 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -497,6 +497,10 @@ unsigned long EVP_MD_flags(const EVP_MD *md); | |||
497 | 497 | ||
498 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); | 498 | const EVP_MD *EVP_MD_CTX_md(const EVP_MD_CTX *ctx); |
499 | void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); | 499 | void *EVP_MD_CTX_md_data(const EVP_MD_CTX *ctx); |
500 | #if defined(LIBRESSL_CRYPTO_INTERANL) || defined(LIBRESSL_NEXT_API) | ||
501 | EVP_PKEY_CTX *EVP_MD_CTX_pkey_ctx(const EVP_MD_CTX *ctx); | ||
502 | void EVP_MD_CTX_set_pkey_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pctx); | ||
503 | #endif | ||
500 | #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) | 504 | #define EVP_MD_CTX_size(e) EVP_MD_size(EVP_MD_CTX_md(e)) |
501 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) | 505 | #define EVP_MD_CTX_block_size(e) EVP_MD_block_size(EVP_MD_CTX_md(e)) |
502 | #define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) | 506 | #define EVP_MD_CTX_type(e) EVP_MD_type(EVP_MD_CTX_md(e)) |