comparison libpurple/certificate.h @ 18940:5fa287322a82

- Fill out CertVerifier struct - CertVerifiers now record only the name of the CertScheme they operate on, which is looked up when a request actually needs to be generated.
author William Ehlhardt <williamehlhardt@gmail.com>
date Fri, 22 Jun 2007 20:49:32 +0000
parents eac58c6caae7
children 425f494bd1ec
comparison
equal deleted inserted replaced
18939:f46ec4d6a385 18940:5fa287322a82
45 typedef struct _PurpleCertificate PurpleCertificate; 45 typedef struct _PurpleCertificate PurpleCertificate;
46 typedef struct _PurpleCertificateScheme PurpleCertificateScheme; 46 typedef struct _PurpleCertificateScheme PurpleCertificateScheme;
47 typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier; 47 typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier;
48 typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest; 48 typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest;
49 49
50 /**
51 * Callback function for the results of a verification check
52 * @param vrq Request structure operated on
53 * @param st Status code
54 * @param userdata User-defined data
55 */
56 typedef void (*PurpleCertificateVerifiedCallback)
57 (PurpleCertificateVerificationRequest *vrq,
58 PurpleCertificateVerificationStatus,
59 gpointer userdata);
60
50 /** A certificate instance 61 /** A certificate instance
51 * 62 *
52 * An opaque data structure representing a single certificate under some 63 * An opaque data structure representing a single certificate under some
53 * CertificateScheme 64 * CertificateScheme
54 */ 65 */
148 159
149 /** A set of operations used to provide logic for verifying a Certificate's 160 /** A set of operations used to provide logic for verifying a Certificate's
150 * authenticity. 161 * authenticity.
151 */ 162 */
152 struct _PurpleCertificateVerifier 163 struct _PurpleCertificateVerifier
153 { 164 {
154 /** Scheme this Verifier operates on */ 165 /** Name of the Verifier - case insensitive */
155 PurpleCertificateScheme *scheme; 166 gchar *name;
156 167
157 /** Internal name used for lookups 168 /** Name of the scheme this Verifier operates on
158 * 169 *
159 * Case insensitive 170 * The scheme will be looked up by name when a Request is generated
160 */ 171 * using this Verifier
161 gchar * name; 172 */
173 gchar *scheme_name;
162 }; 174 };
163 175
164 /** Structure for a single certificate request 176 /** Structure for a single certificate request
165 * 177 *
166 * Useful for keeping track of the state of a verification that involves 178 * Useful for keeping track of the state of a verification that involves
169 struct _PurpleCertificateVerificationRequest 181 struct _PurpleCertificateVerificationRequest
170 { 182 {
171 /** Reference to the verification logic used */ 183 /** Reference to the verification logic used */
172 PurpleCertificateVerifier *verifier; 184 PurpleCertificateVerifier *verifier;
173 185
174 /** Certificate subject's name. 186 /**
187 * Name to check that the certificate is issued to
175 * 188 *
176 * For X.509 certificates, this is the Common Name 189 * For X.509 certificates, this is the Common Name
177 */ 190 */
178 gchar *subject_name; 191 gchar *subject_name;
179 192
183 * The list order should be: certificate, issuer, issuer's issuer, etc. 196 * The list order should be: certificate, issuer, issuer's issuer, etc.
184 */ 197 */
185 GList *cert_chain; 198 GList *cert_chain;
186 199
187 /** Internal data used by the Verifier code */ 200 /** Internal data used by the Verifier code */
188 gpointer *data; 201 gpointer data;
202
203 /** Function to call with the verification result */
204 PurpleCertificateVerifiedCallback cb;
205 /** Data to pass to the post-verification callback */
206 gpointer cb_data;
189 }; 207 };
190 208
191 /*****************************************************************************/ 209 /*****************************************************************************/
192 /** @name PurpleCertificate Subsystem API */ 210 /** @name PurpleCertificate Subsystem API */
193 /*****************************************************************************/ 211 /*****************************************************************************/