aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/evp/evp.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/evp/evp.h')
-rw-r--r--crypto/evp/evp.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/crypto/evp/evp.h b/crypto/evp/evp.h
index beb2c9eb44..cc521feb63 100644
--- a/crypto/evp/evp.h
+++ b/crypto/evp/evp.h
@@ -94,11 +94,13 @@
#define EVP_PK_RSA 0x0001
#define EVP_PK_DSA 0x0002
#define EVP_PK_DH 0x0004
+#define EVP_PK_ECDSA 0x0008
#define EVP_PKT_SIGN 0x0010
#define EVP_PKT_ENC 0x0020
#define EVP_PKT_EXCH 0x0040
#define EVP_PKS_RSA 0x0100
#define EVP_PKS_DSA 0x0200
+#define EVP_PKS_ECDSA 0x0400
#define EVP_PKT_EXP 0x1000 /* <= 512 bit key */
#define EVP_PKEY_NONE NID_undef
@@ -110,6 +112,7 @@
#define EVP_PKEY_DSA3 NID_dsaWithSHA1
#define EVP_PKEY_DSA4 NID_dsaWithSHA1_2
#define EVP_PKEY_DH NID_dhKeyAgreement
+#define EVP_PKEY_ECDSA NID_X9_62_id_ecPublicKey
#ifdef __cplusplus
extern "C" {
@@ -134,6 +137,9 @@ struct evp_pkey_st
#ifndef OPENSSL_NO_DH
struct dh_st *dh; /* DH */
#endif
+#ifndef OPENSSL_NO_ECDSA
+ struct ecdsa_st *ecdsa; /* ECDSA */
+#endif
} pkey;
int save_parameters;
STACK_OF(X509_ATTRIBUTE) *attributes; /* [ 0 ] */
@@ -245,6 +251,13 @@ struct env_md_st
#define EVP_PKEY_DSA_method EVP_PKEY_NULL_method
#endif
+#ifndef OPENSSL_NO_ECDSA
+#define EVP_PKEY_ECDSA_method ECDSA_sign,ECDSA_verify, \
+ {EVP_PKEY_ECDSA,0,0,0}
+#else
+#define EVP_PKEY_ECDSA_method EVP_PKEY_NULL_method
+#endif
+
#ifndef OPENSSL_NO_RSA
#define EVP_PKEY_RSA_method RSA_sign,RSA_verify, \
{EVP_PKEY_RSA,EVP_PKEY_RSA2,0,0}
@@ -385,6 +398,11 @@ typedef int (EVP_PBE_KEYGEN)(EVP_CIPHER_CTX *ctx, const char *pass, int passlen,
(char *)(dh))
#endif
+#ifndef OPENSSL_NO_ECDSA
+#define EVP_PKEY_assign_ECDSA(pkey,ecdsa) EVP_PKEY_assign((pkey),EVP_PKEY_ECDSA,\
+ (char *)(ecdsa))
+#endif
+
/* Add some extra combinations */
#define EVP_get_digestbynid(a) EVP_get_digestbyname(OBJ_nid2sn(a))
#define EVP_get_digestbyobj(a) EVP_get_digestbynid(OBJ_obj2nid(a))
@@ -568,6 +586,7 @@ const EVP_MD *EVP_sha(void);
const EVP_MD *EVP_sha1(void);
const EVP_MD *EVP_dss(void);
const EVP_MD *EVP_dss1(void);
+const EVP_MD *EVP_ecdsa(void);
#endif
#ifndef OPENSSL_NO_MDC2
const EVP_MD *EVP_mdc2(void);
@@ -683,7 +702,11 @@ struct dh_st;
int EVP_PKEY_set1_DH(EVP_PKEY *pkey,struct dh_st *key);
struct dh_st *EVP_PKEY_get1_DH(EVP_PKEY *pkey);
#endif
-
+#ifndef OPENSSL_NO_ECDSA
+struct ecdsa_st;
+int EVP_PKEY_set1_ECDSA(EVP_PKEY *pkey,struct ecdsa_st *key);
+struct ecdsa_st *EVP_PKEY_get1_ECDSA(EVP_PKEY *pkey);
+#endif
EVP_PKEY * EVP_PKEY_new(void);
void EVP_PKEY_free(EVP_PKEY *pkey);
@@ -741,6 +764,7 @@ void ERR_load_EVP_strings(void);
/* Function codes. */
#define EVP_F_D2I_PKEY 100
+#define EVP_F_ECDSA_PKEY2PKCS8 129
#define EVP_F_EVP_CIPHERINIT 123
#define EVP_F_EVP_CIPHER_CTX_CTRL 124
#define EVP_F_EVP_CIPHER_CTX_SET_KEY_LENGTH 122
@@ -759,6 +783,7 @@ void ERR_load_EVP_strings(void);
#define EVP_F_EVP_PKEY_ENCRYPT 105
#define EVP_F_EVP_PKEY_GET1_DH 119
#define EVP_F_EVP_PKEY_GET1_DSA 120
+#define EVP_F_EVP_PKEY_GET1_ECDSA 130
#define EVP_F_EVP_PKEY_GET1_RSA 121
#define EVP_F_EVP_PKEY_NEW 106
#define EVP_F_EVP_RIJNDAEL 126
@@ -770,6 +795,7 @@ void ERR_load_EVP_strings(void);
#define EVP_F_RC5_CTRL 125
/* Reason codes. */
+#define EVP_R_ASN1_LIB 140
#define EVP_R_BAD_BLOCK_LENGTH 136
#define EVP_R_BAD_DECRYPT 100
#define EVP_R_BAD_KEY_LENGTH 137
@@ -786,6 +812,7 @@ void ERR_load_EVP_strings(void);
#define EVP_R_EXPECTING_AN_RSA_KEY 127
#define EVP_R_EXPECTING_A_DH_KEY 128
#define EVP_R_EXPECTING_A_DSA_KEY 129
+#define EVP_R_EXPECTING_A_ECDSA_KEY 141
#define EVP_R_INITIALIZATION_ERROR 134
#define EVP_R_INPUT_NOT_INITIALIZED 111
#define EVP_R_INVALID_KEY_LENGTH 130