OPENSSL_free(xkey);
return 0;
}
- if (id == NID_X25519) {
+ if (id == EVP_PKEY_X25519) {
xkey->privkey[0] &= 248;
xkey->privkey[31] &= 127;
xkey->privkey[31] |= 64;
} else {
memcpy(xkey->privkey, p, X25519_KEYLEN);
}
- if (id == NID_X25519)
+ if (id == EVP_PKEY_X25519)
X25519_public_from_private(xkey->pubkey, xkey->privkey);
else
ED25519_public_from_private(xkey->pubkey, xkey->privkey);
X25519_KEY *xkey = pkey->pkey.ptr;
if (xkey)
- OPENSSL_secure_free(xkey->privkey);
+ OPENSSL_secure_clear_free(xkey->privkey, X25519_KEYLEN);
OPENSSL_free(xkey);
}
switch (op) {
case ASN1_PKEY_CTRL_SET1_TLS_ENCPT:
- return ecx_key_op(pkey, NID_X25519, NULL, arg2, arg1, X25519_PUBLIC);
+ return ecx_key_op(pkey, EVP_PKEY_X25519, NULL, arg2, arg1,
+ X25519_PUBLIC);
case ASN1_PKEY_CTRL_GET1_TLS_ENCPT:
if (pkey->pkey.ptr != NULL) {
}
const EVP_PKEY_ASN1_METHOD ecx25519_asn1_meth = {
- NID_X25519,
- NID_X25519,
+ EVP_PKEY_X25519,
+ EVP_PKEY_X25519,
0,
"X25519",
"OpenSSL X25519 algorithm",
return 3;
}
+static int ecd_sig_info_set(X509_SIG_INFO *siginf, const X509_ALGOR *alg,
+ const ASN1_STRING *sig)
+{
+ X509_SIG_INFO_set(siginf, NID_undef, NID_ED25519, X25519_SECURITY_BITS,
+ X509_SIG_INFO_TLS);
+ return 1;
+}
+
const EVP_PKEY_ASN1_METHOD ed25519_asn1_meth = {
- NID_ED25519,
- NID_ED25519,
+ EVP_PKEY_ED25519,
+ EVP_PKEY_ED25519,
0,
"ED25519",
"OpenSSL ED25519 algorithm",
NULL,
NULL,
ecd_item_verify,
- ecd_item_sign
+ ecd_item_sign,
+ ecd_sig_info_set
};
static int pkey_ecx_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey)
}
const EVP_PKEY_METHOD ecx25519_pkey_meth = {
- NID_X25519,
+ EVP_PKEY_X25519,
0, 0, 0, 0, 0, 0, 0,
pkey_ecx_keygen,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
const EVP_PKEY_METHOD ed25519_pkey_meth = {
- NID_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
+ EVP_PKEY_ED25519, EVP_PKEY_FLAG_SIGCTX_CUSTOM,
0, 0, 0, 0, 0, 0,
pkey_ecx_keygen,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,