]> andersk Git - openssh.git/blobdiff - key.h
- djm@cvs.openbsd.org 2010/01/30 02:54:53
[openssh.git] / key.h
diff --git a/key.h b/key.h
index b6c3eb0109ee954e0145eb5b0f2c6b6187e3bee3..14aac79c2de07d69cf9be3d6640cfecad378852c 100644 (file)
--- a/key.h
+++ b/key.h
@@ -1,5 +1,7 @@
+/* $OpenBSD: key.h,v 1.27 2008/06/11 21:01:35 grunk Exp $ */
+
 /*
- * Copyright (c) 2000 Markus Friedl.  All rights reserved.
+ * Copyright (c) 2000, 2001 Markus Friedl.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -24,6 +26,9 @@
 #ifndef KEY_H
 #define KEY_H
 
+#include <openssl/rsa.h>
+#include <openssl/dsa.h>
+
 typedef struct Key Key;
 enum types {
        KEY_RSA1,
@@ -31,40 +36,53 @@ enum types {
        KEY_DSA,
        KEY_UNSPEC
 };
+enum fp_type {
+       SSH_FP_SHA1,
+       SSH_FP_MD5
+};
+enum fp_rep {
+       SSH_FP_HEX,
+       SSH_FP_BUBBLEBABBLE,
+       SSH_FP_RANDOMART
+};
+
+/* key is stored in external hardware */
+#define KEY_FLAG_EXT           0x0001
+
 struct Key {
-       int     type;
+       int      type;
+       int      flags;
        RSA     *rsa;
        DSA     *dsa;
 };
 
-Key    *key_new(int type);
-Key    *key_new_private(int type);
-void   key_free(Key *k);
-int    key_equal(Key *a, Key *b);
-char   *key_fingerprint(Key *k);
-char   *key_type(Key *k);
-int    key_write(Key *key, FILE *f);
-int    key_read(Key *key, char **cpp);
-u_int  key_size(Key *k);
+Key            *key_new(int);
+Key            *key_new_private(int);
+void            key_free(Key *);
+Key            *key_demote(const Key *);
+int             key_equal(const Key *, const Key *);
+char           *key_fingerprint(const Key *, enum fp_type, enum fp_rep);
+u_char         *key_fingerprint_raw(const Key *, enum fp_type, u_int *);
+const char     *key_type(const Key *);
+int             key_write(const Key *, FILE *);
+int             key_read(Key *, char **);
+u_int           key_size(const Key *);
 
-Key    *key_generate(int type, unsigned int bits);
-Key    *key_from_private(Key *k);
-int    key_type_from_name(char *name);
+Key    *key_generate(int, u_int);
+Key    *key_from_private(const Key *);
+int     key_type_from_name(char *);
 
-Key    *key_from_blob(char *blob, int blen);
-int    key_to_blob(Key *key, unsigned char **blobp, unsigned int *lenp);
-char   *key_ssh_name(Key *k);
+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 *);
+int             key_names_valid2(const char *);
 
-int
-key_sign(
-    Key *key,
-    unsigned char **sigp, int *lenp,
-    unsigned char *data, int datalen);
+int     key_sign(const Key *, u_char **, u_int *, const u_char *, u_int);
+int     key_verify(const Key *, const u_char *, u_int, const u_char *, u_int);
 
-int
-key_verify(
-    Key *key,
-    unsigned char *signature, int signaturelen,
-    unsigned char *data, int datalen);
+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_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);
 
 #endif
This page took 0.03826 seconds and 4 git commands to generate.