summaryrefslogtreecommitdiff
path: root/key.h
diff options
context:
space:
mode:
Diffstat (limited to 'key.h')
-rw-r--r--key.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/key.h b/key.h
index 11d30eae6..2eb124364 100644
--- a/key.h
+++ b/key.h
@@ -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
33typedef struct Key Key; 34typedef struct Key Key;
34enum types { 35enum 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 **);
105int key_cert_is_legacy(Key *); 110int key_cert_is_legacy(Key *);
106 111
112int key_ecdsa_nid_from_name(const char *);
113int key_curve_name_to_nid(const char *);
114const char * key_curve_nid_to_name(int);
115int key_ecdsa_bits_to_nid(int);
116int key_ecdsa_group_to_nid(const EC_GROUP *);
117int key_ec_validate_public(const EC_GROUP *, const EC_POINT *);
118int key_ec_validate_private(const EC_KEY *);
119
107Key *key_from_blob(const u_char *, u_int); 120Key *key_from_blob(const u_char *, u_int);
108int key_to_blob(const Key *, u_char **, u_int *); 121int key_to_blob(const Key *, u_char **, u_int *);
109const char *key_ssh_name(const Key *); 122const char *key_ssh_name(const Key *);
123const char *key_ssh_name_plain(const Key *);
110int key_names_valid2(const char *); 124int key_names_valid2(const char *);
111 125
112int key_sign(const Key *, u_char **, u_int *, const u_char *, u_int); 126int 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
115int ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int); 129int ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
116int ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int); 130int ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
131int ssh_ecdsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
132int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
117int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int); 133int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
118int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int); 134int 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)
137void key_dump_ec_point(const EC_GROUP *, const EC_POINT *);
138void key_dump_ec_key(const EC_KEY *);
139#endif
140
120#endif 141#endif