diff options
Diffstat (limited to 'key.h')
-rw-r--r-- | key.h | 23 |
1 files changed, 22 insertions, 1 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: key.h,v 1.30 2010/04/16 01:47:26 djm Exp $ */ | 1 | /* $OpenBSD: key.h,v 1.31 2010/08/31 11:54:45 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
@@ -29,14 +29,17 @@ | |||
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 | #include <openssl/ec.h> | ||
32 | 33 | ||
33 | typedef struct Key Key; | 34 | typedef struct Key Key; |
34 | enum types { | 35 | enum types { |
35 | KEY_RSA1, | 36 | KEY_RSA1, |
36 | KEY_RSA, | 37 | KEY_RSA, |
37 | KEY_DSA, | 38 | KEY_DSA, |
39 | KEY_ECDSA, | ||
38 | KEY_RSA_CERT, | 40 | KEY_RSA_CERT, |
39 | KEY_DSA_CERT, | 41 | KEY_DSA_CERT, |
42 | KEY_ECDSA_CERT, | ||
40 | KEY_RSA_CERT_V00, | 43 | KEY_RSA_CERT_V00, |
41 | KEY_DSA_CERT_V00, | 44 | KEY_DSA_CERT_V00, |
42 | KEY_UNSPEC | 45 | KEY_UNSPEC |
@@ -73,6 +76,8 @@ struct Key { | |||
73 | int flags; | 76 | int flags; |
74 | RSA *rsa; | 77 | RSA *rsa; |
75 | DSA *dsa; | 78 | DSA *dsa; |
79 | int ecdsa_nid; /* NID of curve */ | ||
80 | EC_KEY *ecdsa; | ||
76 | struct KeyCert *cert; | 81 | struct KeyCert *cert; |
77 | }; | 82 | }; |
78 | 83 | ||
@@ -104,9 +109,18 @@ int key_cert_check_authority(const Key *, int, int, const char *, | |||
104 | const char **); | 109 | const char **); |
105 | int key_cert_is_legacy(Key *); | 110 | int key_cert_is_legacy(Key *); |
106 | 111 | ||
112 | int key_ecdsa_nid_from_name(const char *); | ||
113 | int key_curve_name_to_nid(const char *); | ||
114 | const char * key_curve_nid_to_name(int); | ||
115 | int key_ecdsa_bits_to_nid(int); | ||
116 | int key_ecdsa_group_to_nid(const EC_GROUP *); | ||
117 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); | ||
118 | int key_ec_validate_private(const EC_KEY *); | ||
119 | |||
107 | Key *key_from_blob(const u_char *, u_int); | 120 | Key *key_from_blob(const u_char *, u_int); |
108 | int key_to_blob(const Key *, u_char **, u_int *); | 121 | int key_to_blob(const Key *, u_char **, u_int *); |
109 | const char *key_ssh_name(const Key *); | 122 | const char *key_ssh_name(const Key *); |
123 | const char *key_ssh_name_plain(const Key *); | ||
110 | int key_names_valid2(const char *); | 124 | int key_names_valid2(const char *); |
111 | 125 | ||
112 | int key_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | 126 | int key_sign(const Key *, u_char **, u_int *, const u_char *, u_int); |
@@ -114,7 +128,14 @@ int key_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | |||
114 | 128 | ||
115 | int ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | 129 | int ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int); |
116 | int ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | 130 | int ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int); |
131 | int ssh_ecdsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | ||
132 | int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | ||
117 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | 133 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); |
118 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | 134 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); |
119 | 135 | ||
136 | #if defined(DEBUG_KEXECDH) || defined(DEBUG_PK) | ||
137 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); | ||
138 | void key_dump_ec_key(const EC_KEY *); | ||
139 | #endif | ||
140 | |||
120 | #endif | 141 | #endif |