Fix typo. Add EVP_PKEY_CTX control function for later use by command line
[openssl.git] / apps / apps.c
index c2afdd142add290a0bada10aad6207685ccda733..1b7ca6961f545f7a1a5c7924de3b8ff5b5c440f7 100644 (file)
@@ -2304,6 +2304,24 @@ int bio_to_mem(unsigned char **out, int maxlen, BIO *in)
        return ret;
        }
 
+int pkey_ctrl_string(BIO *err, EVP_PKEY_CTX *ctx, char *value)
+       {
+       char *stmp, *vtmp = NULL;
+       stmp = BUF_strdup(value);
+       int rv;
+       if (!stmp)
+               return -1;
+       vtmp = strchr(stmp, ':');
+       if (vtmp)
+               {
+               *vtmp = 0;
+               vtmp++;
+               }
+       rv = EVP_PKEY_CTX_ctrl_str(ctx, stmp, vtmp);
+       OPENSSL_free(stmp);
+       return rv;
+       }
+
 static void nodes_print(BIO *out, const char *name,
        STACK_OF(X509_POLICY_NODE) *nodes)
        {