diff options
author | Damien Miller <djm@mindrot.org> | 2010-09-10 11:39:26 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2010-09-10 11:39:26 +1000 |
commit | 6af914a15c0c33e8b5bab5ca61919b8562ff1db9 (patch) | |
tree | b87546d8a88a05e6fd600cbb2b8c0b132278cb10 /key.h | |
parent | 041ab7c1e7d6514ed84a539a767f79ffb356e807 (diff) |
- (djm) [authfd.c authfile.c bufec.c buffer.h configure.ac kex.h kexecdh.c]
[kexecdhc.c kexecdhs.c key.c key.h myproposal.h packet.c readconf.c]
[ssh-agent.c ssh-ecdsa.c ssh-keygen.c ssh.c] Disable ECDH and ECDSA on
platforms that don't have the requisite OpenSSL support. ok dtucker@
Diffstat (limited to 'key.h')
-rw-r--r-- | key.h | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -29,7 +29,9 @@ | |||
29 | #include "buffer.h" | 29 | #include "buffer.h" |
30 | #include <openssl/rsa.h> | 30 | #include <openssl/rsa.h> |
31 | #include <openssl/dsa.h> | 31 | #include <openssl/dsa.h> |
32 | #ifdef OPENSSL_HAS_ECC | ||
32 | #include <openssl/ec.h> | 33 | #include <openssl/ec.h> |
34 | #endif | ||
33 | 35 | ||
34 | typedef struct Key Key; | 36 | typedef struct Key Key; |
35 | enum types { | 37 | enum types { |
@@ -77,7 +79,11 @@ struct Key { | |||
77 | RSA *rsa; | 79 | RSA *rsa; |
78 | DSA *dsa; | 80 | DSA *dsa; |
79 | int ecdsa_nid; /* NID of curve */ | 81 | int ecdsa_nid; /* NID of curve */ |
82 | #ifdef OPENSSL_HAS_ECC | ||
80 | EC_KEY *ecdsa; | 83 | EC_KEY *ecdsa; |
84 | #else | ||
85 | void *ecdsa; | ||
86 | #endif | ||
81 | struct KeyCert *cert; | 87 | struct KeyCert *cert; |
82 | }; | 88 | }; |
83 | 89 | ||
@@ -114,10 +120,12 @@ int key_curve_name_to_nid(const char *); | |||
114 | const char * key_curve_nid_to_name(int); | 120 | const char * key_curve_nid_to_name(int); |
115 | u_int key_curve_nid_to_bits(int); | 121 | u_int key_curve_nid_to_bits(int); |
116 | int key_ecdsa_bits_to_nid(int); | 122 | int key_ecdsa_bits_to_nid(int); |
123 | #ifdef OPENSSL_HAS_ECC | ||
117 | int key_ecdsa_group_to_nid(const EC_GROUP *); | 124 | int key_ecdsa_group_to_nid(const EC_GROUP *); |
118 | const EVP_MD * key_ec_nid_to_evpmd(int nid); | 125 | const EVP_MD * key_ec_nid_to_evpmd(int nid); |
119 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); | 126 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); |
120 | int key_ec_validate_private(const EC_KEY *); | 127 | int key_ec_validate_private(const EC_KEY *); |
128 | #endif | ||
121 | 129 | ||
122 | Key *key_from_blob(const u_char *, u_int); | 130 | Key *key_from_blob(const u_char *, u_int); |
123 | int key_to_blob(const Key *, u_char **, u_int *); | 131 | int key_to_blob(const Key *, u_char **, u_int *); |
@@ -135,7 +143,7 @@ int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int) | |||
135 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | 143 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); |
136 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | 144 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); |
137 | 145 | ||
138 | #if defined(DEBUG_KEXECDH) || defined(DEBUG_PK) | 146 | #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK)) |
139 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); | 147 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); |
140 | void key_dump_ec_key(const EC_KEY *); | 148 | void key_dump_ec_key(const EC_KEY *); |
141 | #endif | 149 | #endif |