]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
APPS: Set a default passphrase UI for the "ec" command
authorRichard Levitte <levitte@openssl.org>
Mon, 3 May 2021 06:48:07 +0000 (08:48 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 4 May 2021 09:40:31 +0000 (11:40 +0200)
Fixes #15114

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15119)

apps/ec.c

index 5103838da036949022cb52d69b42616442df7427..f8f77dd492a031e43ce8470c5b0354187b759a71 100644 (file)
--- a/apps/ec.c
+++ b/apps/ec.c
@@ -267,7 +267,10 @@ int ec_main(int argc, char **argv)
                                              NULL);
         if (enc != NULL) {
             OSSL_ENCODER_CTX_set_cipher(ectx, EVP_CIPHER_name(enc), NULL);
+            /* Default passphrase prompter */
+            OSSL_ENCODER_CTX_set_passphrase_ui(ectx, get_ui_method(), NULL);
             if (passout != NULL)
+                /* When passout given, override the passphrase prompter */
                 OSSL_ENCODER_CTX_set_passphrase(ectx,
                                                 (const unsigned char *)passout,
                                                 strlen(passout));