summaryrefslogtreecommitdiff
path: root/key.h
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2013-12-07 11:24:01 +1100
committerDamien Miller <djm@mindrot.org>2013-12-07 11:24:01 +1100
commit5be9d9e3cbd9c66f24745d25bf2e809c1d158ee0 (patch)
treed2086d37436014ea44f0f024396a1a8638640b00 /key.h
parentbcd00abd8451f36142ae2ee10cc657202149201e (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.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/key.h b/key.h
index efa711769..6a049d277 100644
--- a/key.h
+++ b/key.h
@@ -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
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);
@@ -128,7 +135,7 @@ const EVP_MD *key_ec_nid_to_evpmd(int nid);
128int key_ec_validate_public(const EC_GROUP *, const EC_POINT *); 135int key_ec_validate_public(const EC_GROUP *, const EC_POINT *);
129int key_ec_validate_private(const EC_KEY *); 136int key_ec_validate_private(const EC_KEY *);
130#endif 137#endif
131char *key_alg_list(void); 138char *key_alg_list(int, int);
132 139
133Key *key_from_blob(const u_char *, u_int); 140Key *key_from_blob(const u_char *, u_int);
134int key_to_blob(const Key *, u_char **, u_int *); 141int 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);
145int 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);
146int 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);
147int 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);
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))
150void key_dump_ec_point(const EC_GROUP *, const EC_POINT *); 159void key_dump_ec_point(const EC_GROUP *, const EC_POINT *);