summaryrefslogtreecommitdiffstats
path: root/crypto/ec
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-03-24 14:58:57 +1000
committerPauli <paul.dale@oracle.com>2020-03-28 12:27:20 +1000
commit110bff618b5bd3c700f2f0a290612ca642672ce6 (patch)
tree48a183a9f54b95c847f1e0222b82eaafec53da1a /crypto/ec
parent9e885a707d604e9528b5491b78fb9c00f41193fc (diff)
Param builder: make the OSSL_PARAM_BLD APIs public.
The catalyst for this is the difficult of passing BNs through the other OSSL_PARAM APIs. Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com> (Merged from https://github.com/openssl/openssl/pull/11390)
Diffstat (limited to 'crypto/ec')
-rw-r--r--crypto/ec/ec_ameth.c16
-rw-r--r--crypto/ec/ecx_meth.c12
2 files changed, 14 insertions, 14 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index f3812e46b5..85427cf456 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -23,7 +23,7 @@
#include "crypto/asn1.h"
#include "crypto/evp.h"
#include <openssl/core_names.h>
-#include "internal/param_build.h"
+#include "openssl/param_build.h"
#include "ec_local.h"
#ifndef OPENSSL_NO_CMS
@@ -611,7 +611,7 @@ int ecparams_to_params(const EC_KEY *eckey, OSSL_PARAM_BLD *tmpl)
if ((curve_name = OBJ_nid2sn(curve_nid)) == NULL)
return 0;
- if (!ossl_param_bld_push_utf8_string(tmpl, OSSL_PKEY_PARAM_EC_NAME, curve_name, 0))
+ if (!OSSL_PARAM_BLD_push_utf8_string(tmpl, OSSL_PKEY_PARAM_EC_NAME, curve_name, 0))
return 0;
}
@@ -645,7 +645,7 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
if (EC_KEY_get_method(eckey) != EC_KEY_OpenSSL())
return 0;
- ossl_param_bld_init(&tmpl);
+ OSSL_PARAM_BLD_init(&tmpl);
/* export the domain parameters */
if (!ecparams_to_params(eckey, &tmpl))
@@ -660,7 +660,7 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
if ((pub_key_buflen = EC_POINT_point2buf(ecg, pub_point,
POINT_CONVERSION_COMPRESSED,
&pub_key_buf, NULL)) == 0
- || !ossl_param_bld_push_octet_string(&tmpl,
+ || !OSSL_PARAM_BLD_push_octet_string(&tmpl,
OSSL_PKEY_PARAM_PUB_KEY,
pub_key_buf,
pub_key_buflen))
@@ -711,7 +711,7 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
goto err;
sz = (ecbits + 7 ) / 8;
- if (!ossl_param_bld_push_BN_pad(&tmpl,
+ if (!OSSL_PARAM_BLD_push_BN_pad(&tmpl,
OSSL_PKEY_PARAM_PRIV_KEY,
priv_key, sz))
goto err;
@@ -726,20 +726,20 @@ int ec_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
(EC_KEY_get_flags(eckey) & EC_FLAG_COFACTOR_ECDH) ? 1 : 0;
/* Export the ECDH_COFACTOR_MODE parameter */
- if (!ossl_param_bld_push_int(&tmpl,
+ if (!OSSL_PARAM_BLD_push_int(&tmpl,
OSSL_PKEY_PARAM_USE_COFACTOR_ECDH,
ecdh_cofactor_mode))
goto err;
selection |= OSSL_KEYMGMT_SELECT_OTHER_PARAMETERS;
}
- params = ossl_param_bld_to_param(&tmpl);
+ params = OSSL_PARAM_BLD_to_param(&tmpl);
/* We export, the provider imports */
rv = evp_keymgmt_import(to_keymgmt, to_keydata, selection, params);
err:
- ossl_param_bld_free(params);
+ OSSL_PARAM_BLD_free(params);
OPENSSL_free(pub_key_buf);
return rv;
}
diff --git a/crypto/ec/ecx_meth.c b/crypto/ec/ecx_meth.c
index 97d1b13f5a..8a48b28f38 100644
--- a/crypto/ec/ecx_meth.c
+++ b/crypto/ec/ecx_meth.c
@@ -19,7 +19,7 @@
#include <openssl/ec.h>
#include <openssl/rand.h>
#include <openssl/core_names.h>
-#include "internal/param_build.h"
+#include "openssl/param_build.h"
#include "crypto/asn1.h"
#include "crypto/evp.h"
#include "crypto/ecx.h"
@@ -414,29 +414,29 @@ static int ecx_pkey_export_to(const EVP_PKEY *from, void *to_keydata,
int selection = 0;
int rv = 0;
- ossl_param_bld_init(&tmpl);
+ OSSL_PARAM_BLD_init(&tmpl);
/* A key must at least have a public part */
- if (!ossl_param_bld_push_octet_string(&tmpl, OSSL_PKEY_PARAM_PUB_KEY,
+ if (!OSSL_PARAM_BLD_push_octet_string(&tmpl, OSSL_PKEY_PARAM_PUB_KEY,
key->pubkey, key->keylen))
goto err;
selection |= OSSL_KEYMGMT_SELECT_PUBLIC_KEY;
if (key->privkey != NULL) {
- if (!ossl_param_bld_push_octet_string(&tmpl,
+ if (!OSSL_PARAM_BLD_push_octet_string(&tmpl,
OSSL_PKEY_PARAM_PRIV_KEY,
key->privkey, key->keylen))
goto err;
selection |= OSSL_KEYMGMT_SELECT_PRIVATE_KEY;
}
- params = ossl_param_bld_to_param(&tmpl);
+ params = OSSL_PARAM_BLD_to_param(&tmpl);
/* We export, the provider imports */
rv = evp_keymgmt_import(to_keymgmt, to_keydata, selection, params);
err:
- ossl_param_bld_free(params);
+ OSSL_PARAM_BLD_free(params);
return rv;
}