summaryrefslogtreecommitdiff
path: root/key.h
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2011-02-17 11:47:40 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2011-02-17 11:47:40 +0000
commit9f6de2d748109e4e479c9259468a79973631e7fc (patch)
tree1d333e32031110bf9bfd5e15980adf8221240df8 /key.h
parent3a927e69c380468bb32766c99aa7caf86de401a4 (diff)
downloadsrc-test2-9f6de2d748109e4e479c9259468a79973631e7fc.tar.gz
src-test2-9f6de2d748109e4e479c9259468a79973631e7fc.zip
Notes
Diffstat (limited to 'key.h')
-rw-r--r--key.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/key.h b/key.h
index 11d30eae685b..ec5ac5eb87c1 100644
--- a/key.h
+++ b/key.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: key.h,v 1.30 2010/04/16 01:47:26 djm Exp $ */
+/* $OpenBSD: key.h,v 1.33 2010/10/28 11:22:09 djm Exp $ */
/*
* Copyright (c) 2000, 2001 Markus Friedl. All rights reserved.
@@ -29,14 +29,19 @@
#include "buffer.h"
#include <openssl/rsa.h>
#include <openssl/dsa.h>
+#ifdef OPENSSL_HAS_ECC
+#include <openssl/ec.h>
+#endif
typedef struct Key Key;
enum types {
KEY_RSA1,
KEY_RSA,
KEY_DSA,
+ KEY_ECDSA,
KEY_RSA_CERT,
KEY_DSA_CERT,
+ KEY_ECDSA_CERT,
KEY_RSA_CERT_V00,
KEY_DSA_CERT_V00,
KEY_UNSPEC
@@ -73,6 +78,12 @@ struct Key {
int flags;
RSA *rsa;
DSA *dsa;
+ int ecdsa_nid; /* NID of curve */
+#ifdef OPENSSL_HAS_ECC
+ EC_KEY *ecdsa;
+#else
+ void *ecdsa;
+#endif
struct KeyCert *cert;
};
@@ -104,9 +115,22 @@ int key_cert_check_authority(const Key *, int, int, const char *,
const char **);
int key_cert_is_legacy(Key *);
+int key_ecdsa_nid_from_name(const char *);
+int key_curve_name_to_nid(const char *);
+const char * key_curve_nid_to_name(int);
+u_int key_curve_nid_to_bits(int);
+int key_ecdsa_bits_to_nid(int);
+#ifdef OPENSSL_HAS_ECC
+int key_ecdsa_key_to_nid(EC_KEY *);
+const EVP_MD * key_ec_nid_to_evpmd(int nid);
+int key_ec_validate_public(const EC_GROUP *, const EC_POINT *);
+int key_ec_validate_private(const EC_KEY *);
+#endif
+
Key *key_from_blob(const u_char *, u_int);
int key_to_blob(const Key *, u_char **, u_int *);
const char *key_ssh_name(const Key *);
+const char *key_ssh_name_plain(const Key *);
int key_names_valid2(const char *);
int key_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
@@ -114,7 +138,14 @@ int key_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
int ssh_dss_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
int ssh_dss_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
+int ssh_ecdsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
+int ssh_ecdsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
int ssh_rsa_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
int ssh_rsa_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
+#if defined(OPENSSL_HAS_ECC) && (defined(DEBUG_KEXECDH) || defined(DEBUG_PK))
+void key_dump_ec_point(const EC_GROUP *, const EC_POINT *);
+void key_dump_ec_key(const EC_KEY *);
+#endif
+
#endif