diff options
author | Damien Miller <djm@mindrot.org> | 2013-12-07 11:24:01 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2013-12-07 11:24:01 +1100 |
commit | 5be9d9e3cbd9c66f24745d25bf2e809c1d158ee0 (patch) | |
tree | d2086d37436014ea44f0f024396a1a8638640b00 /key.h | |
parent | bcd00abd8451f36142ae2ee10cc657202149201e (diff) |
- markus@cvs.openbsd.org 2013/12/06 13:39:49
[authfd.c authfile.c key.c key.h myproposal.h pathnames.h readconf.c]
[servconf.c ssh-agent.c ssh-keygen.c ssh-keyscan.1 ssh-keyscan.c]
[ssh-keysign.c ssh.c ssh_config.5 sshd.8 sshd.c verify.c ssh-ed25519.c]
[sc25519.h sc25519.c hash.c ge25519_base.data ge25519.h ge25519.c]
[fe25519.h fe25519.c ed25519.c crypto_api.h blocks.c]
support ed25519 keys (hostkeys and user identities) using the public
domain ed25519 reference code from SUPERCOP, see
http://ed25519.cr.yp.to/software.html
feedback, help & ok djm@
Diffstat (limited to 'key.h')
-rw-r--r-- | key.h | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: key.h,v 1.39 2013/12/06 13:30:08 markus Exp $ */ | 1 | /* $OpenBSD: key.h,v 1.40 2013/12/06 13:39:49 markus 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); |
@@ -128,7 +135,7 @@ const EVP_MD *key_ec_nid_to_evpmd(int nid); | |||
128 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); | 135 | int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); |
129 | int key_ec_validate_private(const EC_KEY *); | 136 | int key_ec_validate_private(const EC_KEY *); |
130 | #endif | 137 | #endif |
131 | char *key_alg_list(void); | 138 | char *key_alg_list(int, int); |
132 | 139 | ||
133 | Key *key_from_blob(const u_char *, u_int); | 140 | Key *key_from_blob(const u_char *, u_int); |
134 | int key_to_blob(const Key *, u_char **, u_int *); | 141 | int key_to_blob(const Key *, u_char **, u_int *); |
@@ -145,6 +152,8 @@ int ssh_ecdsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); | |||
145 | 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); |
146 | 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); |
147 | 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); | ||
148 | 157 | ||
149 | #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK)) | 158 | #if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK)) |
150 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); | 159 | void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); |