diff options
Diffstat (limited to 'key.h')
-rw-r--r-- | key.h | 19 |
1 files changed, 16 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: key.h,v 1.37 2013/05/19 02:42:42 djm Exp $ */ | 1 | /* $OpenBSD: key.h,v 1.41 2014/01/09 23:20:00 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. |
@@ -39,9 +39,11 @@ enum types { | |||
39 | KEY_RSA, | 39 | KEY_RSA, |
40 | KEY_DSA, | 40 | KEY_DSA, |
41 | KEY_ECDSA, | 41 | KEY_ECDSA, |
42 | KEY_ED25519, | ||
42 | KEY_RSA_CERT, | 43 | KEY_RSA_CERT, |
43 | KEY_DSA_CERT, | 44 | KEY_DSA_CERT, |
44 | KEY_ECDSA_CERT, | 45 | KEY_ECDSA_CERT, |
46 | KEY_ED25519_CERT, | ||
45 | KEY_RSA_CERT_V00, | 47 | KEY_RSA_CERT_V00, |
46 | KEY_DSA_CERT_V00, | 48 | KEY_DSA_CERT_V00, |
47 | KEY_UNSPEC | 49 | KEY_UNSPEC |
@@ -86,8 +88,13 @@ struct Key { | |||
86 | void *ecdsa; | 88 | void *ecdsa; |
87 | #endif | 89 | #endif |
88 | struct KeyCert *cert; | 90 | struct KeyCert *cert; |
91 | u_char *ed25519_sk; | ||
92 | u_char *ed25519_pk; | ||
89 | }; | 93 | }; |
90 | 94 | ||
95 | #define ED25519_SK_SZ crypto_sign_ed25519_SECRETKEYBYTES | ||
96 | #define ED25519_PK_SZ crypto_sign_ed25519_PUBLICKEYBYTES | ||
97 | |||
91 | Key *key_new(int); | 98 | Key *key_new(int); |
92 | void key_add_private(Key *); | 99 | void key_add_private(Key *); |
93 | Key *key_new_private(int); | 100 | Key *key_new_private(int); |
@@ -107,6 +114,7 @@ Key *key_generate(int, u_int); | |||
107 | Key *key_from_private(const Key *); | 114 | Key *key_from_private(const Key *); |
108 | int key_type_from_name(char *); | 115 | int key_type_from_name(char *); |
109 | int key_is_cert(const Key *); | 116 | int key_is_cert(const Key *); |
117 | int key_type_is_cert(int); | ||
110 | int key_type_plain(int); | 118 | int key_type_plain(int); |
111 | int key_to_certified(Key *, int); | 119 | int key_to_certified(Key *, int); |
112 | int key_drop_cert(Key *); | 120 | int key_drop_cert(Key *); |
@@ -123,11 +131,11 @@ u_int key_curve_nid_to_bits(int); | |||
123 | int key_ecdsa_bits_to_nid(int); | 131 | int key_ecdsa_bits_to_nid(int); |
124 | #ifdef OPENSSL_HAS_ECC | 132 | #ifdef OPENSSL_HAS_ECC |
125 | int key_ecdsa_key_to_nid(EC_KEY *); | 133 | int key_ecdsa_key_to_nid(EC_KEY *); |
126 | const EVP_MD *key_ec_nid_to_evpmd(int nid); | 134 | int key_ec_nid_to_hash_alg(int nid); |
127 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); | 135 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); |
128 | int key_ec_validate_private(const EC_KEY *); | 136 | int key_ec_validate_private(const EC_KEY *); |
129 | #endif | 137 | #endif |
130 | char *key_alg_list(void); | 138 | char *key_alg_list(int, int); |
131 | 139 | ||
132 | Key *key_from_blob(const u_char *, u_int); | 140 | Key *key_from_blob(const u_char *, u_int); |
133 | int key_to_blob(const Key *, u_char **, u_int *); | 141 | int key_to_blob(const Key *, u_char **, u_int *); |
@@ -144,10 +152,15 @@ int ssh_ecdsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | |||
144 | int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | 152 | int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); |
145 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | 153 | int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); |
146 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | 154 | int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); |
155 | int ssh_ed25519_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | ||
156 | int ssh_ed25519_verify(const Key *, const u_char *, u_int, const u_char *, u_int); | ||
147 | 157 | ||
148 | #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK)) | 158 | #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK)) |
149 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); | 159 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); |
150 | void key_dump_ec_key(const EC_KEY *); | 160 | void key_dump_ec_key(const EC_KEY *); |
151 | #endif | 161 | #endif |
152 | 162 | ||
163 | void key_private_serialize(const Key *, Buffer *); | ||
164 | Key *key_private_deserialize(Buffer *); | ||
165 | |||
153 | #endif | 166 | #endif |