@@ -80,37 +80,65 @@ typedef enum {
8080 GIT_CERT_SSH_SHA1 = (1 << 1 ),
8181 /** SHA-256 is available */
8282 GIT_CERT_SSH_SHA256 = (1 << 2 ),
83+ /** Raw hostkey is available */
84+ GIT_CERT_SSH_RAW = (1 << 3 ),
8385} git_cert_ssh_t ;
8486
87+ typedef enum {
88+ /** The raw key is of an unknown type. */
89+ GIT_CERT_SSH_RAW_TYPE_UNKNOWN = 0 ,
90+ /** The raw key is an RSA key. */
91+ GIT_CERT_SSH_RAW_TYPE_RSA = 1 ,
92+ /** The raw key is a DSS key. */
93+ GIT_CERT_SSH_RAW_TYPE_DSS = 2 ,
94+ } git_cert_ssh_raw_type_t ;
95+
8596/**
8697 * Hostkey information taken from libssh2
8798 */
8899typedef struct {
89100 git_cert parent ; /**< The parent cert */
90101
91102 /**
92- * A hostkey type from libssh2, either
93- * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
103+ * A bitmask containing the available fields.
94104 */
95105 git_cert_ssh_t type ;
96106
97107 /**
98- * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
108+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_MD5` set, this will
99109 * have the MD5 hash of the hostkey.
100110 */
101111 unsigned char hash_md5 [16 ];
102112
103113 /**
104- * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
114+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_SHA1` set, this will
105115 * have the SHA-1 hash of the hostkey.
106116 */
107117 unsigned char hash_sha1 [20 ];
108118
109119 /**
110- * Hostkey hash. If type has `GIT_CERT_SSH_SHA256` set, this will
120+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_SHA256` set, this will
111121 * have the SHA-256 hash of the hostkey.
112122 */
113123 unsigned char hash_sha256 [32 ];
124+
125+ /**
126+ * Raw hostkey type. If `type` has `GIT_CERT_SSH_RAW` set, this will
127+ * have the type of the raw hostkey.
128+ */
129+ git_cert_ssh_raw_type_t raw_type ;
130+
131+ /**
132+ * Pointer to the raw hostkey. If `type` has `GIT_CERT_SSH_RAW` set,
133+ * this will have the raw contents of the hostkey.
134+ */
135+ const char * hostkey ;
136+
137+ /**
138+ * Raw hostkey length. If `type` has `GIT_CERT_SSH_RAW` set, this will
139+ * have the length of the raw contents of the hostkey.
140+ */
141+ size_t hostkey_len ;
114142} git_cert_hostkey ;
115143
116144/**
0 commit comments