summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/dhparam.c2
-rw-r--r--apps/rsa.c2
-rw-r--r--crypto/asn1/i2d_evp.c3
-rw-r--r--crypto/evp/evp_pkey.c4
-rw-r--r--crypto/evp/p_lib.c9
-rw-r--r--crypto/pem/pem_local.h2
-rw-r--r--crypto/pem/pem_pk8.c30
-rw-r--r--crypto/x509/x_pubkey.c8
-rw-r--r--test/endecode_test.c2
-rw-r--r--test/endecoder_legacy_test.c6
-rw-r--r--test/evp_libctx_test.c2
-rw-r--r--test/evp_pkey_provided_test.c2
12 files changed, 31 insertions, 41 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c
index e2fb38d8c0..58cdfd000d 100644
--- a/apps/dhparam.c
+++ b/apps/dhparam.c
@@ -325,7 +325,7 @@ int dhparam_main(int argc, char **argv)
OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS,
outformat == FORMAT_ASN1
? "DER" : "PEM",
- NULL, NULL, NULL);
+ NULL, NULL);
if (ectx == NULL || !OSSL_ENCODER_to_bio(ectx, out)) {
OSSL_ENCODER_CTX_free(ectx);
diff --git a/apps/rsa.c b/apps/rsa.c
index da1342b4c0..058c2be2ad 100644
--- a/apps/rsa.c
+++ b/apps/rsa.c
@@ -323,7 +323,7 @@ int rsa_main(int argc, char **argv)
/* Now, perform the encoding */
ectx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection,
output_type, output_structure,
- NULL, NULL);
+ NULL);
if (OSSL_ENCODER_CTX_get_num_encoders(ectx) == 0) {
BIO_printf(bio_err, "%s format not supported\n", output_type);
goto end;
diff --git a/crypto/asn1/i2d_evp.c b/crypto/asn1/i2d_evp.c
index d0468bf5c2..da1d136184 100644
--- a/crypto/asn1/i2d_evp.c
+++ b/crypto/asn1/i2d_evp.c
@@ -42,8 +42,7 @@ static int i2d_provided(const EVP_PKEY *a, int selection,
size_t len = INT_MAX;
ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(a, selection, "DER",
- *output_structures,
- NULL, NULL);
+ *output_structures, NULL);
if (ctx == NULL)
return -1;
if (OSSL_ENCODER_to_data(ctx, pp, &len))
diff --git a/crypto/evp/evp_pkey.c b/crypto/evp/evp_pkey.c
index b049420d0b..dd20a52e7a 100644
--- a/crypto/evp/evp_pkey.c
+++ b/crypto/evp/evp_pkey.c
@@ -81,15 +81,13 @@ PKCS8_PRIV_KEY_INFO *EVP_PKEY2PKCS8(const EVP_PKEY *pkey)
*/
if (evp_pkey_is_provided(pkey)) {
int selection = OSSL_KEYMGMT_SELECT_ALL;
- const OSSL_PROVIDER *prov = EVP_KEYMGMT_provider(pkey->keymgmt);
- OSSL_LIB_CTX *libctx = ossl_provider_libctx(prov);
unsigned char *der = NULL;
size_t derlen = 0;
const unsigned char *pp;
if ((ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection,
"DER", "pkcs8",
- libctx, NULL)) == NULL
+ NULL)) == NULL
|| !OSSL_ENCODER_to_data(ctx, &der, &derlen))
goto error;
diff --git a/crypto/evp/p_lib.c b/crypto/evp/p_lib.c
index cf29071318..b8c623f90a 100644
--- a/crypto/evp/p_lib.c
+++ b/crypto/evp/p_lib.c
@@ -1140,7 +1140,6 @@ static int unsup_alg(BIO *out, const EVP_PKEY *pkey, int indent,
static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,
int selection /* For provided encoding */,
- OSSL_LIB_CTX *libctx /* For provided encoding */,
const char *propquery /* For provided encoding */,
int (*legacy_print)(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx),
@@ -1155,7 +1154,7 @@ static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,
return 0;
ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection, "TEXT", NULL,
- libctx, propquery);
+ propquery);
if (OSSL_ENCODER_CTX_get_num_encoders(ctx) != 0)
ret = OSSL_ENCODER_to_bio(ctx, out);
OSSL_ENCODER_CTX_free(ctx);
@@ -1177,7 +1176,7 @@ static int print_pkey(const EVP_PKEY *pkey, BIO *out, int indent,
int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx)
{
- return print_pkey(pkey, out, indent, EVP_PKEY_PUBLIC_KEY, NULL, NULL,
+ return print_pkey(pkey, out, indent, EVP_PKEY_PUBLIC_KEY, NULL,
(pkey->ameth != NULL ? pkey->ameth->pub_print : NULL),
pctx);
}
@@ -1185,7 +1184,7 @@ int EVP_PKEY_print_public(BIO *out, const EVP_PKEY *pkey,
int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx)
{
- return print_pkey(pkey, out, indent, EVP_PKEY_KEYPAIR, NULL, NULL,
+ return print_pkey(pkey, out, indent, EVP_PKEY_KEYPAIR, NULL,
(pkey->ameth != NULL ? pkey->ameth->priv_print : NULL),
pctx);
}
@@ -1193,7 +1192,7 @@ int EVP_PKEY_print_private(BIO *out, const EVP_PKEY *pkey,
int EVP_PKEY_print_params(BIO *out, const EVP_PKEY *pkey,
int indent, ASN1_PCTX *pctx)
{
- return print_pkey(pkey, out, indent, EVP_PKEY_KEY_PARAMETERS, NULL, NULL,
+ return print_pkey(pkey, out, indent, EVP_PKEY_KEY_PARAMETERS, NULL,
(pkey->ameth != NULL ? pkey->ameth->param_print : NULL),
pctx);
}
diff --git a/crypto/pem/pem_local.h b/crypto/pem/pem_local.h
index 7de2a71045..728fefb33a 100644
--- a/crypto/pem/pem_local.h
+++ b/crypto/pem/pem_local.h
@@ -49,7 +49,7 @@
OSSL_ENCODER_CTX *ctx = \
OSSL_ENCODER_CTX_new_by_##type(x, PEM_SELECTION_##asn1, \
"PEM", PEM_STRUCTURE_##asn1, \
- NULL, NULL); \
+ NULL); \
\
if (OSSL_ENCODER_CTX_get_num_encoders(ctx) == 0) { \
OSSL_ENCODER_CTX_free(ctx); \
diff --git a/crypto/pem/pem_pk8.c b/crypto/pem/pem_pk8.c
index 560754007b..09d38855b6 100644
--- a/crypto/pem/pem_pk8.c
+++ b/crypto/pem/pem_pk8.c
@@ -22,14 +22,14 @@ static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OSSL_LIB_CTX *libctx, const char *propq);
+ const char *propq);
#ifndef OPENSSL_NO_STDIO
static int do_pk8pkey_fp(FILE *bp, const EVP_PKEY *x, int isder,
int nid, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u,
- OSSL_LIB_CTX *libctx, const char *propq);
+ const char *propq);
#endif
/*
* These functions write a private key in PKCS#8 format: it is a "drop in"
@@ -42,40 +42,39 @@ int PEM_write_bio_PKCS8PrivateKey_nid(BIO *bp, const EVP_PKEY *x, int nid,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey(bp, x, 0, nid, NULL, kstr, klen, cb, u, NULL);
}
int PEM_write_bio_PKCS8PrivateKey(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey(bp, x, 0, -1, enc, kstr, klen, cb, u, NULL);
}
int i2d_PKCS8PrivateKey_bio(BIO *bp, const EVP_PKEY *x, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey(bp, x, 1, -1, enc, kstr, klen, cb, u, NULL);
}
int i2d_PKCS8PrivateKey_nid_bio(BIO *bp, const EVP_PKEY *x, int nid,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey(bp, x, 1, nid, NULL, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey(bp, x, 1, nid, NULL, kstr, klen, cb, u, NULL);
}
static int do_pk8pkey(BIO *bp, const EVP_PKEY *x, int isder, int nid,
const EVP_CIPHER *enc, const char *kstr, int klen,
- pem_password_cb *cb, void *u,
- OSSL_LIB_CTX *libctx, const char *propq)
+ pem_password_cb *cb, void *u, const char *propq)
{
int ret = 0;
const char *outtype = isder ? "DER" : "PEM";
OSSL_ENCODER_CTX *ctx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(x, OSSL_KEYMGMT_SELECT_ALL,
- outtype, "pkcs8", libctx, propq);
+ outtype, "pkcs8", propq);
if (ctx == NULL)
return 0;
@@ -203,34 +202,33 @@ int i2d_PKCS8PrivateKey_fp(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey_fp(fp, x, 1, -1, enc, kstr, klen, cb, u, NULL);
}
int i2d_PKCS8PrivateKey_nid_fp(FILE *fp, const EVP_PKEY *x, int nid,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey_fp(fp, x, 1, nid, NULL, kstr, klen, cb, u, NULL);
}
int PEM_write_PKCS8PrivateKey_nid(FILE *fp, const EVP_PKEY *x, int nid,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey_fp(fp, x, 0, nid, NULL, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey_fp(fp, x, 0, nid, NULL, kstr, klen, cb, u, NULL);
}
int PEM_write_PKCS8PrivateKey(FILE *fp, const EVP_PKEY *x, const EVP_CIPHER *enc,
const char *kstr, int klen,
pem_password_cb *cb, void *u)
{
- return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u, NULL, NULL);
+ return do_pk8pkey_fp(fp, x, 0, -1, enc, kstr, klen, cb, u, NULL);
}
static int do_pk8pkey_fp(FILE *fp, const EVP_PKEY *x, int isder, int nid,
const EVP_CIPHER *enc, const char *kstr, int klen,
- pem_password_cb *cb, void *u,
- OSSL_LIB_CTX *libctx, const char *propq)
+ pem_password_cb *cb, void *u, const char *propq)
{
BIO *bp;
int ret;
@@ -239,7 +237,7 @@ static int do_pk8pkey_fp(FILE *fp, const EVP_PKEY *x, int isder, int nid,
ERR_raise(ERR_LIB_PEM, ERR_R_BUF_LIB);
return 0;
}
- ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u, libctx, propq);
+ ret = do_pk8pkey(bp, x, isder, nid, enc, kstr, klen, cb, u, propq);
BIO_free(bp);
return ret;
}
diff --git a/crypto/x509/x_pubkey.c b/crypto/x509/x_pubkey.c
index 674b7d48cf..9f5b5d3c3d 100644
--- a/crypto/x509/x_pubkey.c
+++ b/crypto/x509/x_pubkey.c
@@ -98,14 +98,12 @@ int X509_PUBKEY_set(X509_PUBKEY **x, EVP_PKEY *pkey)
goto error;
}
} else if (evp_pkey_is_provided(pkey)) {
- const OSSL_PROVIDER *pkprov = EVP_KEYMGMT_provider(pkey->keymgmt);
- OSSL_LIB_CTX *libctx = ossl_provider_libctx(pkprov);
unsigned char *der = NULL;
size_t derlen = 0;
OSSL_ENCODER_CTX *ectx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, EVP_PKEY_PUBLIC_KEY,
"DER", "SubjectPublicKeyInfo",
- libctx, NULL);
+ NULL);
if (OSSL_ENCODER_to_data(ectx, &der, &derlen)) {
const unsigned char *pder = der;
@@ -306,12 +304,10 @@ int i2d_PUBKEY(const EVP_PKEY *a, unsigned char **pp)
}
X509_PUBKEY_free(xpk);
} else if (a->keymgmt != NULL) {
- const OSSL_PROVIDER *pkprov = EVP_KEYMGMT_provider(a->keymgmt);
- OSSL_LIB_CTX *libctx = ossl_provider_libctx(pkprov);
OSSL_ENCODER_CTX *ctx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(a, EVP_PKEY_PUBLIC_KEY,
"DER", "SubjectPublicKeyInfo",
- libctx, NULL);
+ NULL);
BIO *out = BIO_new(BIO_s_mem());
BUF_MEM *buf = NULL;
diff --git a/test/endecode_test.c b/test/endecode_test.c
index d7edd350a1..f72f9aaac8 100644
--- a/test/endecode_test.c
+++ b/test/endecode_test.c
@@ -195,7 +195,7 @@ static int encode_EVP_PKEY_prov(void **encoded, long *encoded_len,
if (!TEST_ptr(ectx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pkey, selection,
output_type,
output_structure,
- NULL, NULL))
+ NULL))
|| !TEST_int_gt(OSSL_ENCODER_CTX_get_num_encoders(ectx), 0)
|| (pass != NULL
&& !TEST_true(OSSL_ENCODER_CTX_set_passphrase(ectx, upass,
diff --git a/test/endecoder_legacy_test.c b/test/endecoder_legacy_test.c
index 467c072b3e..ffaa25da7b 100644
--- a/test/endecoder_legacy_test.c
+++ b/test/endecoder_legacy_test.c
@@ -319,7 +319,7 @@ static int test_protected_PEM(const char *keytype, int evp_type,
if (!TEST_ptr(ectx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(provided_pkey, selection,
"PEM", structure,
- NULL, NULL))
+ NULL))
|| !TEST_true(OSSL_ENCODER_to_bio(ectx, membio_provided))
|| !TEST_true(pem_write_bio(membio_legacy, legacy_key,
NULL, NULL, 0, NULL, NULL))
@@ -387,7 +387,7 @@ static int test_unprotected_PEM(const char *keytype, int evp_type,
if (!TEST_ptr(ectx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(provided_pkey, selection,
"PEM", structure,
- NULL, NULL))
+ NULL))
|| !TEST_true(OSSL_ENCODER_to_bio(ectx, membio_provided))
|| !TEST_true(pem_write_bio(membio_legacy, legacy_key))
|| !test_membio_str_eq(membio_provided, membio_legacy))
@@ -452,7 +452,7 @@ static int test_DER(const char *keytype, int evp_type,
if (!TEST_ptr(ectx =
OSSL_ENCODER_CTX_new_by_EVP_PKEY(provided_pkey, selection,
"DER", structure,
- NULL, NULL))
+ NULL))
|| !TEST_true(OSSL_ENCODER_to_data(ectx,
&der_provided, &der_provided_len))
|| !TEST_size_t_gt(der_legacy_len = i2d(legacy_key, &der_legacy), 0)
diff --git a/test/evp_libctx_test.c b/test/evp_libctx_test.c
index a1540dd4b9..cf39bf0871 100644
--- a/test/evp_libctx_test.c
+++ b/test/evp_libctx_test.c
@@ -461,7 +461,7 @@ static int rsa_keygen(int bits, EVP_PKEY **pub, EVP_PKEY **priv)
OSSL_ENCODER_CTX_new_by_EVP_PKEY(*priv,
EVP_PKEY_PUBLIC_KEY,
"DER", "type-specific",
- libctx, NULL))
+ NULL))
|| !TEST_true(OSSL_ENCODER_to_data(ectx, &pub_der, &len)))
goto err;
pp = pub_der;
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c
index 7d12a919c1..a5604b4fdf 100644
--- a/test/evp_pkey_provided_test.c
+++ b/test/evp_pkey_provided_test.c
@@ -217,7 +217,7 @@ static int test_print_key_type_using_encoder(const char *alg, int type,
if (!TEST_ptr(ctx = OSSL_ENCODER_CTX_new_by_EVP_PKEY(pk, selection,
output_type,
output_structure,
- NULL, NULL))
+ NULL))
/* Check that this operation is supported */
|| !TEST_int_ne(OSSL_ENCODER_CTX_get_num_encoders(ctx), 0))
goto err;