summaryrefslogtreecommitdiffstats
path: root/providers/implementations/encode_decode/decode_pvk2key.c
diff options
context:
space:
mode:
Diffstat (limited to 'providers/implementations/encode_decode/decode_pvk2key.c')
-rw-r--r--providers/implementations/encode_decode/decode_pvk2key.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/providers/implementations/encode_decode/decode_pvk2key.c b/providers/implementations/encode_decode/decode_pvk2key.c
index 6624773d9b..819014231c 100644
--- a/providers/implementations/encode_decode/decode_pvk2key.c
+++ b/providers/implementations/encode_decode/decode_pvk2key.c
@@ -79,6 +79,17 @@ static void pvk2key_freectx(void *vctx)
OPENSSL_free(ctx);
}
+static int pvk2key_does_selection(void *provctx, int selection)
+{
+ if (selection == 0)
+ return 1;
+
+ if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0)
+ return 1;
+
+ return 0;
+}
+
static int pvk2key_decode(void *vctx, OSSL_CORE_BIO *cin, int selection,
OSSL_CALLBACK *data_cb, void *data_cbarg,
OSSL_PASSPHRASE_CALLBACK *pw_cb, void *pw_cbarg)
@@ -226,6 +237,8 @@ static void rsa_adjust(void *key, struct pvk2key_ctx_st *ctx)
(void (*)(void))pvk2##keytype##_newctx }, \
{ OSSL_FUNC_DECODER_FREECTX, \
(void (*)(void))pvk2key_freectx }, \
+ { OSSL_FUNC_DECODER_DOES_SELECTION, \
+ (void (*)(void))pvk2key_does_selection }, \
{ OSSL_FUNC_DECODER_DECODE, \
(void (*)(void))pvk2key_decode }, \
{ OSSL_FUNC_DECODER_EXPORT_OBJECT, \