From 0d124b0a51d3ad8c8807cab280ea18fc68489155 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 1 Jun 2018 12:22:28 +0100 Subject: Add support getting raw private/public keys Only applies to algorithms that support it. Both raw private and public keys can be obtained for X25519, Ed25519, X448, Ed448. Raw private keys only can be obtained for HMAC, Poly1305 and SipHash Fixes #6259 Reviewed-by: Rich Salz Reviewed-by: Tim Hudson (Merged from https://github.com/openssl/openssl/pull/6394) --- crypto/include/internal/asn1_int.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'crypto/include') diff --git a/crypto/include/internal/asn1_int.h b/crypto/include/internal/asn1_int.h index 962c3c6302..b8a6762aa1 100644 --- a/crypto/include/internal/asn1_int.h +++ b/crypto/include/internal/asn1_int.h @@ -61,6 +61,8 @@ struct evp_pkey_asn1_method_st { /* Get/set raw private/public key data */ int (*set_priv_key) (EVP_PKEY *pk, const unsigned char *priv, size_t len); int (*set_pub_key) (EVP_PKEY *pk, const unsigned char *pub, size_t len); + int (*get_priv_key) (const EVP_PKEY *pk, unsigned char *priv, size_t *len); + int (*get_pub_key) (const EVP_PKEY *pk, unsigned char *pub, size_t *len); } /* EVP_PKEY_ASN1_METHOD */ ; DEFINE_STACK_OF_CONST(EVP_PKEY_ASN1_METHOD) -- cgit v1.2.3