]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Document skey decoder
authorDmitry Belyavskiy <beldmit@gmail.com>
Thu, 25 Sep 2025 13:38:53 +0000 (15:38 +0200)
committerNeil Horman <nhorman@openssl.org>
Wed, 10 Dec 2025 17:20:44 +0000 (12:20 -0500)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Simo Sorce <simo@redhat.com>
(Merged from https://github.com/openssl/openssl/pull/28278)

apps/enc.c
apps/include/apps.h
apps/lib/apps.c
doc/man7/provider-decoder.pod

index fa8adc8970d866b2ba5f62c576e057103c51e7be..1c47cbd80c64594b7306493286d53ddeb36bb782 100644 (file)
@@ -731,19 +731,14 @@ int enc_main(int argc, char **argv)
                 goto end;
             }
         } else {
-            char *storepass = NULL;
+            if (skeyuri != NULL) {
+                char *storepass = NULL;
 
-            if (!app_passwd(storepassarg, NULL, &storepass, NULL)) {
-                BIO_printf(bio_err,
-                    "Error getting store password from 'storepass' argument\n");
-            }
-            mgmt = EVP_SKEYMGMT_fetch(app_get0_libctx(),
-                skeymgmt != NULL ? skeymgmt : EVP_CIPHER_name(cipher),
-                app_get0_propq());
-            if (mgmt == NULL)
-                goto end;
+                if (!app_passwd(storepassarg, NULL, &storepass, NULL)) {
+                    BIO_printf(bio_err,
+                        "Error getting store password from 'storepass' argument\n");
+                }
 
-            if (skeyuri != NULL) {
                 skey = load_skey(skeyuri, FORMAT_UNDEF, 0, storepass, 0);
                 OPENSSL_free(storepass);
                 if (skey == NULL) {
index b4792a6f07c565036e89288c7db6fe0f8918c919..2113669f5d762ba5f7f56edeee2ae9038cc27d66 100644 (file)
@@ -156,7 +156,7 @@ int load_key_certs_crls(const char *uri, int format, int maybe_stdin,
     EVP_PKEY **ppkey, EVP_PKEY **ppubkey,
     EVP_PKEY **pparams,
     X509 **pcert, STACK_OF(X509) **pcerts,
-    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls.
+    X509_CRL **pcrl, STACK_OF(X509_CRL) **pcrls,
     EVP_SKEY **pskey);
 EVP_SKEY *load_skey(const char *uri, int format, int maybe_stdin,
     const char *pass, int quiet);
index 2a36c4215abb7c09106d24c8bb1f101ebda1133e..77c70586ec5b7a0929f2b5abe55692faa69c0f72 100644 (file)
@@ -856,14 +856,14 @@ static const char *format2string(int format)
         SET_EXPECT(val);       \
     }
 /* Provide (error msg) text for some of the credential types to be loaded. */
-#define FAIL_NAME                                                             \
-    (ppkey != NULL ? "private key" : ppubkey != NULL ? "public key"           \
-            : pparams != NULL                        ? "key parameters"       \
-            : pcert != NULL                          ? "certificate"          \
-            : pcerts != NULL                         ? "certificates"         \
-            : pcrl != NULL                           ? "CRL"                  \
-            : pcrls != NULL                          ? "CRLs"                 \
-            : pskey != NULL                          ? "symmetric key" : NULL \
+#define FAIL_NAME                                                       \
+    (ppkey != NULL ? "private key" : ppubkey != NULL ? "public key"     \
+            : pparams != NULL                        ? "key parameters" \
+            : pcert != NULL                          ? "certificate"    \
+            : pcerts != NULL                         ? "certificates"   \
+            : pcrl != NULL                           ? "CRL"            \
+            : pcrls != NULL                          ? "CRLs"           \
+            : pskey != NULL                          ? "symmetric key"  \
                                                      : NULL)
 /*
  * Load those types of credentials for which the result pointer is not NULL.
index d19deec4af5b3a1f0bef2aab125de2249bd0bb57..a69319c233bdc42fe8506cff9bdaa57a96abe7b0 100644 (file)
@@ -143,6 +143,11 @@ An implementation with that input type decodes MSBLOB formatted data.
 
 An implementation with that input type decodes PVK formatted data.
 
+=item raw
+
+An implementation with that input type decodes the provided data as raw bytes.
+This is currently used for symmetric keys.
+
 =back
 
 =item structure