summaryrefslogtreecommitdiff
path: root/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'key.h')
-rw-r--r--key.h19
1 files changed, 16 insertions, 3 deletions
diff --git a/key.h b/key.h
index 17358ae1f..d8ad13d08 100644
--- a/key.h
+++ b/key.h
@@ -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
91Key *key_new(int); 98Key *key_new(int);
92void key_add_private(Key *); 99void key_add_private(Key *);
93Key *key_new_private(int); 100Key *key_new_private(int);
@@ -107,6 +114,7 @@ Key *key_generate(int, u_int);
107Key *key_from_private(const Key *); 114Key *key_from_private(const Key *);
108int key_type_from_name(char *); 115int key_type_from_name(char *);
109int key_is_cert(const Key *); 116int key_is_cert(const Key *);
117int key_type_is_cert(int);
110int key_type_plain(int); 118int key_type_plain(int);
111int key_to_certified(Key *, int); 119int key_to_certified(Key *, int);
112int key_drop_cert(Key *); 120int key_drop_cert(Key *);
@@ -123,11 +131,11 @@ u_int key_curve_nid_to_bits(int);
123int key_ecdsa_bits_to_nid(int); 131int key_ecdsa_bits_to_nid(int);
124#ifdef OPENSSL_HAS_ECC 132#ifdef OPENSSL_HAS_ECC
125int key_ecdsa_key_to_nid(EC_KEY *); 133int key_ecdsa_key_to_nid(EC_KEY *);
126const EVP_MD *key_ec_nid_to_evpmd(int nid); 134int key_ec_nid_to_hash_alg(int nid);
127int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); 135int key_ec_validate_public(const EC_GROUP *, const EC_POINT *);
128int key_ec_validate_private(const EC_KEY *); 136int key_ec_validate_private(const EC_KEY *);
129#endif 137#endif
130char *key_alg_list(void); 138char *key_alg_list(int, int);
131 139
132Key *key_from_blob(const u_char *, u_int); 140Key *key_from_blob(const u_char *, u_int);
133int key_to_blob(const Key *, u_char **, u_int *); 141int 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);
144int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); 152int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
145int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); 153int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
146int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); 154int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
155int ssh_ed25519_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
156int 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))
149void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); 159void key_dump_ec_point(const EC_GROUP *, const EC_POINT *);
150void key_dump_ec_key(const EC_KEY *); 160void key_dump_ec_key(const EC_KEY *);
151#endif 161#endif
152 162
163void key_private_serialize(const Key *, Buffer *);
164Key *key_private_deserialize(Buffer *);
165
153#endif 166#endif