return ossl_pw_set_pem_password_cb(&ctx->pwdata, cb, cbarg);
}
+int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx,
+ OSSL_PASSPHRASE_CALLBACK *cb,
+ void *cbarg)
+{
+ return ossl_pw_set_ossl_passphrase_cb(&ctx->pwdata, cb, cbarg);
+}
+
/*
* Support for OSSL_DECODER_CTX_new_by_EVP_PKEY:
* The construct data, and collecting keymgmt information for it
OSSL_DECODER_CTX_new_by_EVP_PKEY,
OSSL_DECODER_CTX_set_passphrase,
OSSL_DECODER_CTX_set_pem_password_cb,
-OSSL_DECODER_CTX_set_passphrase_ui
+OSSL_DECODER_CTX_set_passphrase_ui,
+OSSL_DECODER_CTX_set_passphrase_cb
- Decoder routines to decode EVP_PKEYs
=head1 SYNOPSIS
int OSSL_DECODER_CTX_set_passphrase_ui(OSSL_DECODER_CTX *ctx,
const UI_METHOD *ui_method,
void *ui_data);
+ int OSSL_DECODER_CTX_set_passphrase_cb(OSSL_DECODER_CTX *ctx,
+ OSSL_PASSPHRASE_CALLBACK *cb,
+ void *cbarg);
=head1 DESCRIPTION
Alternatively, a pass phrase callback may be specified with the
following functions.
-OSSL_DECODER_CTX_set_pem_password_cb() and
-OSSL_DECODER_CTX_set_passphrase_ui() set up a callback method that
+OSSL_DECODER_CTX_set_pem_password_cb(),
+OSSL_DECODER_CTX_set_passphrase_ui() and
+OSSL_DECODER_CTX_set_passphrase_cb() set up a callback method that
the implementation can use to prompt for a pass phrase, giving the caller
the choice of prefered pass phrase callback form. These are called
indirectly, through an internal B<OSSL_PASSPHRASE_CALLBACK> function.
-The internal B<OSSL_PASSPHRASE_CALLBACK> function caches the pass phrase, to
-be re-used in all decodings that are performed in the same
-decoding run
+The internal B<OSSL_PASSPHRASE_CALLBACK> function caches the pass phrase,
+to be re-used in all decodings that are performed in the same decoding run
(for example, within one L<OSSL_DECODER_from_bio(3)> call).
-=for comment the name OSSL_DECODER_CTX_set_pem_password_cb() leaves
-open the future possibility of having a function where the caller can set a
-B<OSSL_PASSPHRASE_CALLBACK> method as another option.
-
=head1 RETURN VALUES
OSSL_DECODER_CTX_new_by_EVP_PKEY() returns a pointer to a
B<OSSL_DECODER_CTX>, or NULL if it couldn't be created.
OSSL_DECODER_CTX_set_passphrase(),
-OSSL_DECODER_CTX_set_pem_password_cb() and
-OSSL_DECODER_CTX_set_passphrase_ui()
+OSSL_DECODER_CTX_set_pem_password_cb(),
+OSSL_DECODER_CTX_set_passphrase_ui() and
+OSSL_DECODER_CTX_set_passphrase_cb()
all return 1 on success, or 0 on failure.
=head1 NOTES