@@ -77,35 +77,70 @@ const
7777 GIT_CERT_SSH_SHA1 = ( 1 shl 1 );
7878 (* * SHA-256 is available *)
7979 GIT_CERT_SSH_SHA256 = ( 1 shl 2 );
80+ (* * Raw hostkey is available *)
81+ GIT_CERT_SSH_RAW = ( 1 shl 3 );
8082type
8183 git_cert_ssh_t = Integer;
8284
85+ const
86+ (* * The raw key is of an unknown type. *)
87+ GIT_CERT_SSH_RAW_TYPE_UNKNOWN = 0 ;
88+ (* * The raw key is an RSA key. *)
89+ GIT_CERT_SSH_RAW_TYPE_RSA = 1 ;
90+ (* * The raw key is a DSS key. *)
91+ GIT_CERT_SSH_RAW_TYPE_DSS = 2 ;
92+ (* * The raw key is a ECDSA 256 key. *)
93+ GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_256 = 3 ;
94+ (* * The raw key is a ECDSA 384 key. *)
95+ GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_384 = 4 ;
96+ (* * The raw key is a ECDSA 521 key. *)
97+ GIT_CERT_SSH_RAW_TYPE_KEY_ECDSA_521 = 5 ;
98+ (* * The raw key is a ED25519 key. *)
99+ GIT_CERT_SSH_RAW_TYPE_KEY_ED25519 = 6 ;
100+ type
101+ git_cert_ssh_raw_type_t = Integer;
102+
103+
83104 (* *
84105 * Hostkey information taken from libssh2
85106 *)
86107
87108 git_cert_hostkey = record
88109 parent : git_cert; (* *< The parent cert *)
89110 (* *
90- * A hostkey type from libssh2, either
91- * `GIT_CERT_SSH_MD5` or `GIT_CERT_SSH_SHA1`
92- *)
111+ * A bitmask containing the available fields.
112+ *)
93113 type_ : git_cert_ssh_t;
94114 (* *
95- * Hostkey hash. If type has `GIT_CERT_SSH_MD5` set, this will
96- * have the MD5 hash of the hostkey.
97- *)
115+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_MD5` set, this will
116+ * have the MD5 hash of the hostkey.
117+ *)
98118 hash_md5 : array [0 ..15 ] of Byte;
99119 (* *
100- * Hostkey hash. If type has `GIT_CERT_SSH_SHA1` set, this will
101- * have the SHA-1 hash of the hostkey.
102- *)
120+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_SHA1` set, this will
121+ * have the SHA-1 hash of the hostkey.
122+ *)
103123 hash_sha1 : array [0 ..19 ] of Byte;
104124 (* *
105- * Hostkey hash. If type has `GIT_CERT_SSH_SHA256` set, this will
106- * have the SHA-256 hash of the hostkey.
107- *)
125+ * Hostkey hash. If ` type` has `GIT_CERT_SSH_SHA256` set, this will
126+ * have the SHA-256 hash of the hostkey.
127+ *)
108128 hash_sha256 : array [0 ..31 ] of Byte;
129+ (* *
130+ * Raw hostkey type. If `type` has `GIT_CERT_SSH_RAW` set, this will
131+ * have the type of the raw hostkey.
132+ *)
133+ raw_type: git_cert_ssh_raw_type_t;
134+ (* *
135+ * Pointer to the raw hostkey. If `type` has `GIT_CERT_SSH_RAW` set,
136+ * this will have the raw contents of the hostkey.
137+ *)
138+ hostkey: PAnsiChar;
139+ (* *
140+ * Raw hostkey length. If `type` has `GIT_CERT_SSH_RAW` set, this will
141+ * have the length of the raw contents of the hostkey.
142+ *)
143+ hostkey_len: size_t;
109144 end ;
110145 Pgit_cert_hostkey = ^git_cert_hostkey;
111146
@@ -116,12 +151,12 @@ type
116151 git_cert_x509 = record
117152 parent : git_cert; (* *< The parent cert *)
118153 (* *
119- * Pointer to the X.509 certificate data
120- *)
154+ * Pointer to the X.509 certificate data
155+ *)
121156 data : Pointer;
122157 (* *
123- * Length of the memory block pointed to by `data`.
124- *)
158+ * Length of the memory block pointed to by `data`.
159+ *)
125160 len : size_t;
126161 end ;
127162 Pgit_cert_x509 = ^git_cert_x509;
0 commit comments