Tue, 07 Mar 2017 00:22:58 -0300
certificate: Use public key fingerprint to compare certificates
This fixes an issue with google talk's certificates and gnutls, where the root
certificate in the provided chain is a slightly different version of the one
that is usually present in the certificate stores, but the SubjectPublicKeyInfo
section is the same.
This adds a PurpleCertificateScheme function, compare_pubkeys, and its wrapper
purple_certificate_compare_pubkeys().
This is only implemented for gnutls, since the NSS plugin only uses the NSS
certificate validation code. Even if that path was reachable from a plugin that
doesn't implement this method, it would return FALSE and behave as if this bug
was never fixed.
The gnutls implementation uses the gnutls_x509_crt_get_key_id() function,
which returns a hash of the SubjectPublicKeyInfo section of the certificate.
In gnutls versions older than 3.4.1, this may be a SHA1 hash, but after that
version SHA256 support was added (without much fanfare - the documentation
barely mentions this at all), and we just use the constant for the best known
algo, which for current versions is just SHA256. Older versions ignore that
flag parameter.
The whole comparison is modeled after the private _gnutls_check_if_same_key(),
which checks if both certificates have the same DN ("unique id") and does a
memcmp() of the raw SPKI section. We don't have direct access to the raw SPKI
section but comparing their fingerprints is good enough.
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
1 | /** |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
2 | * @file certificate.h Public-Key Certificate API |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
3 | * @ingroup core |
|
20890
c4253dc37ac0
ChangeLog by resiak@soc.pidgin.im:
Will Thompson <resiak@pidgin.im>
parents:
19859
diff
changeset
|
4 | * @see @ref certificate-signals |
|
20940
925d3d68b3af
Doxygen @since tags for libpurple and pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20890
diff
changeset
|
5 | * @since 2.2.0 |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
6 | */ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
7 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
8 | /* |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
9 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
10 | * purple |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
11 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
12 | * Purple is the legal property of its developers, whose names are too numerous |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
13 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
14 | * source distribution. |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
15 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
16 | * This program is free software; you can redistribute it and/or modify |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
17 | * it under the terms of the GNU General Public License as published by |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
18 | * the Free Software Foundation; either version 2 of the License, or |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
19 | * (at your option) any later version. |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
20 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
21 | * This program is distributed in the hope that it will be useful, |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
24 | * GNU General Public License for more details. |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
25 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
26 | * You should have received a copy of the GNU General Public License |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
27 | * along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19840
diff
changeset
|
28 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
29 | */ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
30 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
31 | #ifndef _PURPLE_CERTIFICATE_H |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
32 | #define _PURPLE_CERTIFICATE_H |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
33 | |
|
22396
e0813f691fe2
felipec noticed that this include was missing.
Daniel Atallah <datallah@pidgin.im>
parents:
22001
diff
changeset
|
34 | #include <time.h> |
|
e0813f691fe2
felipec noticed that this include was missing.
Daniel Atallah <datallah@pidgin.im>
parents:
22001
diff
changeset
|
35 | |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
36 | #include <glib.h> |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
37 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
38 | #ifdef __cplusplus |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
39 | extern "C" { |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
40 | #endif /* __cplusplus */ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
41 | |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
42 | |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
43 | typedef enum |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
44 | { |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
45 | PURPLE_CERTIFICATE_INVALID = 0, |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
46 | PURPLE_CERTIFICATE_VALID = 1 |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
47 | } PurpleCertificateVerificationStatus; |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
48 | |
|
36191
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
49 | /* |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
50 | * TODO: Merge this with PurpleCertificateVerificationStatus for 3.0.0 */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
51 | typedef enum { |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
52 | PURPLE_CERTIFICATE_UNKNOWN_ERROR = -1, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
53 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
54 | /* Not an error */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
55 | PURPLE_CERTIFICATE_NO_PROBLEMS = 0, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
56 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
57 | /* Non-fatal */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
58 | PURPLE_CERTIFICATE_NON_FATALS_MASK = 0x0000FFFF, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
59 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
60 | /* The certificate is self-signed. */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
61 | PURPLE_CERTIFICATE_SELF_SIGNED = 0x01, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
62 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
63 | /* The CA is not in libpurple's pool of certificates. */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
64 | PURPLE_CERTIFICATE_CA_UNKNOWN = 0x02, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
65 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
66 | /* The current time is before the certificate's specified |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
67 | * activation time. |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
68 | */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
69 | PURPLE_CERTIFICATE_NOT_ACTIVATED = 0x04, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
70 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
71 | /* The current time is after the certificate's specified expiration time */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
72 | PURPLE_CERTIFICATE_EXPIRED = 0x08, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
73 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
74 | /* The certificate's subject name doesn't match the expected */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
75 | PURPLE_CERTIFICATE_NAME_MISMATCH = 0x10, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
76 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
77 | /* No CA pool was found. This shouldn't happen... */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
78 | PURPLE_CERTIFICATE_NO_CA_POOL = 0x20, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
79 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
80 | /* Fatal */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
81 | PURPLE_CERTIFICATE_FATALS_MASK = 0xFFFF0000, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
82 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
83 | /* The signature chain could not be validated. Due to limitations in the |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
84 | * the current API, this also indicates one of the CA certificates in the |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
85 | * chain is expired (or not yet activated). FIXME 3.0.0 */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
86 | PURPLE_CERTIFICATE_INVALID_CHAIN = 0x10000, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
87 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
88 | /* The signature has been revoked. */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
89 | PURPLE_CERTIFICATE_REVOKED = 0x20000, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
90 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
91 | PURPLE_CERTIFICATE_LAST = 0x40000, |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
92 | } PurpleCertificateInvalidityFlags; |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
93 | |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
94 | typedef struct _PurpleCertificate PurpleCertificate; |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
95 | typedef struct _PurpleCertificatePool PurpleCertificatePool; |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
96 | typedef struct _PurpleCertificateScheme PurpleCertificateScheme; |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
97 | typedef struct _PurpleCertificateVerifier PurpleCertificateVerifier; |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
98 | typedef struct _PurpleCertificateVerificationRequest PurpleCertificateVerificationRequest; |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
99 | |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
100 | /** |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
101 | * Callback function for the results of a verification check |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
102 | * @param st Status code |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
103 | * @param userdata User-defined data |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
104 | */ |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
105 | typedef void (*PurpleCertificateVerifiedCallback) |
|
18473
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
106 | (PurpleCertificateVerificationStatus st, |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
107 | gpointer userdata); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
108 | |
|
17509
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
109 | /** A certificate instance |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
110 | * |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
111 | * An opaque data structure representing a single certificate under some |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
112 | * CertificateScheme |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
113 | */ |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
114 | struct _PurpleCertificate |
|
17509
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
115 | { |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
116 | /** Scheme this certificate is under */ |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
117 | PurpleCertificateScheme * scheme; |
|
17509
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
118 | /** Opaque pointer to internal data */ |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
119 | gpointer data; |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
120 | }; |
|
fa009823dbfd
- Exposed the _Certificate struct definition in certificate.h
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17508
diff
changeset
|
121 | |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
122 | /** |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
123 | * Database for retrieval or storage of Certificates |
|
18572
8c2c02e8fa9e
Documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18571
diff
changeset
|
124 | * |
|
18584
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
125 | * More or less a hash table; all lookups and writes are controlled by a string |
|
18572
8c2c02e8fa9e
Documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18571
diff
changeset
|
126 | * key. |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
127 | */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
128 | struct _PurpleCertificatePool |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
129 | { |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
130 | /** Scheme this Pool operates for */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
131 | gchar *scheme_name; |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
132 | /** Internal name to refer to the pool by */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
133 | gchar *name; |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
134 | |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
135 | /** User-friendly name for this type |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
136 | * ex: N_("SSL Servers") |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
137 | * When this is displayed anywhere, it should be i18ned |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
138 | * ex: _(pool->fullname) |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
139 | */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
140 | gchar *fullname; |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
141 | |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
142 | /** Internal pool data */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
143 | gpointer data; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
144 | |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
145 | /** |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
146 | * Set up the Pool's internal state |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
147 | * |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
148 | * Upon calling purple_certificate_register_pool() , this function will |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
149 | * be called. May be NULL. |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
150 | * @return TRUE if the initialization succeeded, otherwise FALSE |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
151 | */ |
|
18494
fc93e7020e83
- CertificatePool member functions no longer accept a Pool instance, as Pools are expected to be singletons
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18493
diff
changeset
|
152 | gboolean (* init)(void); |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
153 | |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
154 | /** |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
155 | * Uninit the Pool's internal state |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
156 | * |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
157 | * Will be called by purple_certificate_unregister_pool() . May be NULL |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
158 | */ |
|
18494
fc93e7020e83
- CertificatePool member functions no longer accept a Pool instance, as Pools are expected to be singletons
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18493
diff
changeset
|
159 | void (* uninit)(void); |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
160 | |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
161 | /** Check for presence of a certificate in the pool using unique ID */ |
|
18493
a4ee6630e3fb
- cert_in_pool_by_id is now just cert_in_pool; finding the uniqueID of the Certificate wanted is entirely the caller's problem
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18490
diff
changeset
|
162 | gboolean (* cert_in_pool)(const gchar *id); |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
163 | /** Retrieve a PurpleCertificate from the pool */ |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
164 | PurpleCertificate * (* get_cert)(const gchar *id); |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
165 | /** Add a certificate to the pool. Must overwrite any other |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
166 | * certificates sharing the same ID in the pool. |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
167 | * @return TRUE if the operation succeeded, otherwise FALSE |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
168 | */ |
|
18571
abab131c242c
- CertificatePool put_cert now accepts an id argument
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18496
diff
changeset
|
169 | gboolean (* put_cert)(const gchar *id, PurpleCertificate *crt); |
|
18899
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
170 | /** Delete a certificate from the pool */ |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
171 | gboolean (* delete_cert)(const gchar *id); |
|
18661
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
172 | |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
173 | /** Returns a list of IDs stored in the pool */ |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
174 | GList * (* get_idlist)(void); |
|
19827
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
175 | |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
176 | void (*_purple_reserved1)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
177 | void (*_purple_reserved2)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
178 | void (*_purple_reserved3)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
179 | void (*_purple_reserved4)(void); |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
180 | }; |
|
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
181 | |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
182 | /** A certificate type |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
183 | * |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
184 | * A CertificateScheme must implement all of the fields in the structure, |
|
18456
1971d0938744
- Documentation correction
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18454
diff
changeset
|
185 | * and register it using purple_certificate_register_scheme() |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
186 | * |
|
17508
65f10c9a063b
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17506
diff
changeset
|
187 | * There may be only ONE CertificateScheme provided for each certificate |
|
65f10c9a063b
- Fixed a comment
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17506
diff
changeset
|
188 | * type, as specified by the "name" field. |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
189 | */ |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
190 | struct _PurpleCertificateScheme |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
191 | { |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
192 | /** Name of the certificate type |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
193 | * ex: "x509", "pgp", etc. |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
194 | * This must be globally unique - you may not register more than one |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
195 | * CertificateScheme of the same name at a time. |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
196 | */ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
197 | gchar * name; |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
198 | |
|
18247
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
199 | /** User-friendly name for this type |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
200 | * ex: N_("X.509 Certificates") |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
201 | * When this is displayed anywhere, it should be i18ned |
|
18489
591ff6f5dca7
- Add CertificatePool struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18481
diff
changeset
|
202 | * ex: _(scheme->fullname) |
|
18247
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
203 | */ |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
204 | gchar * fullname; |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
205 | |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
206 | /** Imports a certificate from a file |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
207 | * |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
208 | * @param filename File to import the certificate from |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
209 | * @return Pointer to the newly allocated Certificate struct |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
210 | * or NULL on failure. |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
211 | */ |
|
18249
21467a007ea7
- Eliminate compiler warning
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18248
diff
changeset
|
212 | PurpleCertificate * (* import_certificate)(const gchar * filename); |
|
18247
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
213 | |
|
18496
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
214 | /** |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
215 | * Exports a certificate to a file |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
216 | * |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
217 | * @param filename File to export the certificate to |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
218 | * @param crt Certificate to export |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
219 | * @return TRUE if the export succeeded, otherwise FALSE |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
220 | * @see purple_certificate_export() |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
221 | */ |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
222 | gboolean (* export_certificate)(const gchar *filename, PurpleCertificate *crt); |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
223 | |
|
18653
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
224 | /** |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
225 | * Duplicates a certificate |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
226 | * |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
227 | * Certificates are generally assumed to be read-only, so feel free to |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
228 | * do any sort of reference-counting magic you want here. If this ever |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
229 | * changes, please remember to change the magic accordingly. |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
230 | * @return Reference to the new copy |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
231 | */ |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
232 | PurpleCertificate * (* copy_certificate)(PurpleCertificate *crt); |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
233 | |
|
18247
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
234 | /** Destroys and frees a Certificate structure |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
235 | * |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
236 | * Destroys a Certificate's internal data structures and calls |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
237 | * free(crt) |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
238 | * |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
239 | * @param crt Certificate instance to be destroyed. It WILL NOT be |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
240 | * destroyed if it is not of the correct |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
241 | * CertificateScheme. Can be NULL |
|
d9f7c426dbc9
- Expose some more functions in the x509 CertificateScheme. Doesn't
William Ehlhardt <williamehlhardt@gmail.com>
parents:
17509
diff
changeset
|
242 | */ |
|
18248
8f462eaffecd
- Style issues
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18247
diff
changeset
|
243 | void (* destroy_certificate)(PurpleCertificate * crt); |
|
18454
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
244 | |
|
36191
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
245 | /** Find whether "crt" has a valid signature from "issuer," including |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
246 | * appropriate values for the CA flag in the basic constraints extension. |
|
19016
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
247 | * @see purple_certificate_signed_by() */ |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
248 | gboolean (*signed_by)(PurpleCertificate *crt, PurpleCertificate *issuer); |
|
18454
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
249 | /** |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
250 | * Retrieves the certificate public key fingerprint using SHA1 |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
251 | * |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
252 | * @param crt Certificate instance |
|
18457
e9e60bed8906
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18456
diff
changeset
|
253 | * @return Binary representation of SHA1 hash - must be freed using |
|
e9e60bed8906
- More documentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18456
diff
changeset
|
254 | * g_byte_array_free() |
|
18454
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
255 | */ |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
256 | GByteArray * (* get_fingerprint_sha1)(PurpleCertificate *crt); |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
257 | |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
258 | /** |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
259 | * Retrieves a unique certificate identifier |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
260 | * |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
261 | * @param crt Certificate instance |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
262 | * @return Newly allocated string that can be used to uniquely |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
263 | * identify the certificate. |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
264 | */ |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
265 | gchar * (* get_unique_id)(PurpleCertificate *crt); |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
266 | |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
267 | /** |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
268 | * Retrieves a unique identifier for the certificate's issuer |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
269 | * |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
270 | * @param crt Certificate instance |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
271 | * @return Newly allocated string that can be used to uniquely |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
272 | * identify the issuer's certificate. |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
273 | */ |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
274 | gchar * (* get_issuer_unique_id)(PurpleCertificate *crt); |
|
9a56a88152b9
- Add more to the Certificate struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18453
diff
changeset
|
275 | |
|
18481
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
276 | /** |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
277 | * Gets the certificate subject's name |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
278 | * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
279 | * For X.509, this is the "Common Name" field, as we're only using it |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
280 | * for hostname verification at the moment |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
281 | * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
282 | * @see purple_certificate_get_subject_name() |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
283 | * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
284 | * @param crt Certificate instance |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
285 | * @return Newly allocated string with the certificate subject. |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
286 | */ |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
287 | gchar * (* get_subject_name)(PurpleCertificate *crt); |
|
18641
4b3c12392054
- Add get_activation_time and get_expiration_time to CertificateScheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18584
diff
changeset
|
288 | |
|
18643
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
289 | /** |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
290 | * Check the subject name against that on the certificate |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
291 | * @see purple_certificate_check_subject_name() |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
292 | * @return TRUE if it is a match, else FALSE |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
293 | */ |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
294 | gboolean (* check_subject_name)(PurpleCertificate *crt, const gchar *name); |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
295 | |
|
19007
f3c3ddf37812
- Change the internal structure of activation/expiration times to match
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19000
diff
changeset
|
296 | /** Retrieve the certificate activation/expiration times */ |
|
f3c3ddf37812
- Change the internal structure of activation/expiration times to match
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19000
diff
changeset
|
297 | gboolean (* get_times)(PurpleCertificate *crt, time_t *activation, time_t *expiration); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
298 | |
|
29930
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
299 | /** Imports certificates from a file |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
300 | * |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
301 | * @param filename File to import the certificates from |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
302 | * @return GSList of pointers to the newly allocated Certificate structs |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
303 | * or NULL on failure. |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
304 | */ |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
305 | GSList * (* import_certificates)(const gchar * filename); |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
306 | |
|
36191
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
307 | /** |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
308 | * Register a certificate as "trusted." |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
309 | */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
310 | gboolean (* register_trusted_tls_cert)(PurpleCertificate *crt, gboolean ca); |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
311 | |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
312 | /** |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
313 | * Verify that a certificate is valid, performing all necessary checks |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
314 | * including date range, valid cert chain, recognized and valid CAs, etc. |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
315 | */ |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
316 | void (* verify_cert)(PurpleCertificateVerificationRequest *vrq, PurpleCertificateInvalidityFlags *flags); |
|
2e4475087f04
Fix basic constraints checking for both our SSL plugins.
Mark Doliner <mark@kingant.net>
parents:
36144
diff
changeset
|
317 | |
|
38214
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
318 | /** |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
319 | * The size of the PurpleCertificateScheme. This should always be sizeof(PurpleCertificateScheme). |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
320 | * This allows adding more functions to this struct without requiring a major version bump. |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
321 | * |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
322 | * PURPLE_CERTIFICATE_SCHEME_HAS_FUNC() should be used for functions after this point. |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
323 | */ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
324 | unsigned long struct_size; |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
325 | |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
326 | /** |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
327 | * Retrieves the certificate public key fingerprint using SHA256 |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
328 | * |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
329 | * @param crt Certificate instance |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
330 | * @return Binary representation of SHA256 hash - must be freed using |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
331 | * g_byte_array_free() |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
332 | * @since 2.12.0 |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
333 | */ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
334 | GByteArray * (* get_fingerprint_sha256)(PurpleCertificate *crt); |
|
38216
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
335 | |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
336 | /** |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
337 | * Compares the public keys of two certificates |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
338 | * |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
339 | * @param crt1 A certificate instance |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
340 | * @param crt2 Another certificate instance |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
341 | * @return TRUE if both certificates have the same key, otherwise FALSE |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
342 | * @since 2.12.0 |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
343 | */ |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
344 | gboolean (* compare_pubkeys)(PurpleCertificate *crt1, PurpleCertificate *crt2); |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
345 | }; |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
346 | |
|
38214
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
347 | #define PURPLE_CERTIFICATE_SCHEME_HAS_FUNC(obj, member) \ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
348 | (((G_STRUCT_OFFSET(PurpleCertificateScheme, member) < G_STRUCT_OFFSET(PurpleCertificateScheme, struct_size)) \ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
349 | || (G_STRUCT_OFFSET(PurpleCertificateScheme, member) < obj->struct_size)) && \ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
350 | obj->member != NULL) |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
351 | |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
352 | |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
353 | /** A set of operations used to provide logic for verifying a Certificate's |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
354 | * authenticity. |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
355 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
356 | * A Verifier provider must fill out these fields, then register it using |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
357 | * purple_certificate_register_verifier() |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
358 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
359 | * The (scheme_name, name) value must be unique for each Verifier - you may not |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
360 | * register more than one Verifier of the same name for each Scheme |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
361 | */ |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
362 | struct _PurpleCertificateVerifier |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
363 | { |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
364 | /** Name of the scheme this Verifier operates on |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
365 | * |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
366 | * The scheme will be looked up by name when a Request is generated |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
367 | * using this Verifier |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
368 | */ |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
369 | gchar *scheme_name; |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
370 | |
|
18471
2eb86930cfaf
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18470
diff
changeset
|
371 | /** Name of the Verifier - case insensitive */ |
|
2eb86930cfaf
- Reorder struct for clarity
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18470
diff
changeset
|
372 | gchar *name; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
373 | |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
374 | /** |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
375 | * Start the verification process |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
376 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
377 | * To be called from purple_certificate_verify once it has |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
378 | * constructed the request. This will use the information in the |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
379 | * given VerificationRequest to check the certificate and callback |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
380 | * the requester with the verification results. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
381 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
382 | * @param vrq Request to process |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
383 | */ |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
384 | void (* start_verification)(PurpleCertificateVerificationRequest *vrq); |
|
18467
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
385 | |
|
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
386 | /** |
|
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
387 | * Destroy a completed Request under this Verifier |
|
18472
c7b825e0f75b
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18471
diff
changeset
|
388 | * The function pointed to here is only responsible for cleaning up |
|
c7b825e0f75b
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18471
diff
changeset
|
389 | * whatever PurpleCertificateVerificationRequest::data points to. |
|
c7b825e0f75b
- libpurple is now responsible for some cleanup and final deletion of a
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18471
diff
changeset
|
390 | * It should not call free(vrq) |
|
18467
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
391 | * |
|
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
392 | * @param vrq Request to destroy |
|
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
393 | */ |
|
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
394 | void (* destroy_request)(PurpleCertificateVerificationRequest *vrq); |
|
19827
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
395 | |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
396 | void (*_purple_reserved1)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
397 | void (*_purple_reserved2)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
398 | void (*_purple_reserved3)(void); |
|
62c3805f723e
- Add purple_reserved fields to various structures.
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19489
diff
changeset
|
399 | void (*_purple_reserved4)(void); |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
400 | }; |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
401 | |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
402 | /** Structure for a single certificate request |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
403 | * |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
404 | * Useful for keeping track of the state of a verification that involves |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
405 | * several steps |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
406 | */ |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
407 | struct _PurpleCertificateVerificationRequest |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
408 | { |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
409 | /** Reference to the verification logic used */ |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
410 | PurpleCertificateVerifier *verifier; |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
411 | /** Reference to the scheme used. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
412 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
413 | * This is looked up from the Verifier when the Request is generated |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
414 | */ |
|
18462
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
415 | PurpleCertificateScheme *scheme; |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
416 | |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
417 | /** |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
418 | * Name to check that the certificate is issued to |
|
18451
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
419 | * |
|
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
420 | * For X.509 certificates, this is the Common Name |
|
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
421 | */ |
|
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
422 | gchar *subject_name; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
423 | |
|
18451
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
424 | /** List of certificates in the chain to be verified (such as that returned by purple_ssl_get_peer_certificates ) |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
425 | * |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
426 | * This is most relevant for X.509 certificates used in SSL sessions. |
|
18451
304d2fa12f6a
- purple_ssl_get_peer_certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18448
diff
changeset
|
427 | * The list order should be: certificate, issuer, issuer's issuer, etc. |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
428 | */ |
|
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
429 | GList *cert_chain; |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
430 | |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
431 | /** Internal data used by the Verifier code */ |
|
18460
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
432 | gpointer data; |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
433 | |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
434 | /** Function to call with the verification result */ |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
435 | PurpleCertificateVerifiedCallback cb; |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
436 | /** Data to pass to the post-verification callback */ |
|
cceca1e961ad
- Fill out CertVerifier struct
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18457
diff
changeset
|
437 | gpointer cb_data; |
|
18448
961dae46f969
- More API additions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18446
diff
changeset
|
438 | }; |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
439 | |
|
18465
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
440 | /*****************************************************************************/ |
|
18583
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
441 | /** @name Certificate Verification Functions */ |
|
18465
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
442 | /*****************************************************************************/ |
|
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
443 | /*@{*/ |
|
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
444 | |
|
18462
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
445 | /** |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
446 | * Constructs a verification request and passed control to the specified Verifier |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
447 | * |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
448 | * It is possible that the callback will be called immediately upon calling |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
449 | * this function. Plan accordingly. |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
450 | * |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
451 | * @param verifier Verification logic to use. |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
452 | * @see purple_certificate_find_verifier() |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
453 | * |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
454 | * @param subject_name Name that should match the first certificate in the |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
455 | * chain for the certificate to be valid. Will be strdup'd |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
456 | * into the Request struct |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
457 | * |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
458 | * @param cert_chain Certificate chain to check. If there is more than one |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
459 | * certificate in the chain (X.509), the peer's |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
460 | * certificate comes first, then the issuer/signer's |
|
18656
02c822b398d2
- purple_certificate_verify no longer takes possession of the
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18655
diff
changeset
|
461 | * certificate, etc. The whole list is duplicated into the |
|
02c822b398d2
- purple_certificate_verify no longer takes possession of the
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18655
diff
changeset
|
462 | * Request struct. |
|
18462
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
463 | * |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
464 | * @param cb Callback function to be called with whether the |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
465 | * certificate was approved or not. |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
466 | * @param cb_data User-defined data for the above. |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
467 | */ |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
468 | void |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
469 | purple_certificate_verify (PurpleCertificateVerifier *verifier, |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
470 | const gchar *subject_name, GList *cert_chain, |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
471 | PurpleCertificateVerifiedCallback cb, |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
472 | gpointer cb_data); |
|
2c6d71addbdb
- purple_certificate_verify now takes a Verifier argument, creates its
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18461
diff
changeset
|
473 | |
|
18466
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
474 | /** |
|
19028
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
475 | * Completes and destroys a VerificationRequest |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
476 | * |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
477 | * @param vrq Request to conclude |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
478 | * @param st Success/failure code to pass to the request's |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
479 | * completion callback. |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
480 | */ |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
481 | void |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
482 | purple_certificate_verify_complete(PurpleCertificateVerificationRequest *vrq, |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
483 | PurpleCertificateVerificationStatus st); |
|
1c28409e9c5f
- Add verify_complete, which should deprecate verify_destroy
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19022
diff
changeset
|
484 | |
|
18583
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
485 | /*@}*/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
486 | |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
487 | /*****************************************************************************/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
488 | /** @name Certificate Functions */ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
489 | /*****************************************************************************/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
490 | /*@{*/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
491 | |
|
18467
6bd91f3acf84
- Add purple_certificate_verify_destroy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18466
diff
changeset
|
492 | /** |
|
18653
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
493 | * Makes a duplicate of a certificate |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
494 | * |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
495 | * @param crt Instance to duplicate |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
496 | * @return Pointer to new instance |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
497 | */ |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
498 | PurpleCertificate * |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
499 | purple_certificate_copy(PurpleCertificate *crt); |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
500 | |
|
ac29c2efe90e
- Add purple_certificate_copy and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18647
diff
changeset
|
501 | /** |
|
18655
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
502 | * Duplicates an entire list of certificates |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
503 | * |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
504 | * @param crt_list List to duplicate |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
505 | * @return New list copy |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
506 | */ |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
507 | GList * |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
508 | purple_certificate_copy_list(GList *crt_list); |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
509 | |
|
43b99fe59f54
- Add purple_certificate_copy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18653
diff
changeset
|
510 | /** |
|
18466
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
511 | * Destroys and free()'s a Certificate |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
512 | * |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
513 | * @param crt Instance to destroy. May be NULL. |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
514 | */ |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
515 | void |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
516 | purple_certificate_destroy (PurpleCertificate *crt); |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
517 | |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
518 | /** |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
519 | * Destroy an entire list of Certificate instances and the containing list |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
520 | * |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
521 | * @param crt_list List of certificates to destroy. May be NULL. |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
522 | */ |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
523 | void |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
524 | purple_certificate_destroy_list (GList * crt_list); |
|
881319eb171d
- Add certificate_destroy and certificate_destroy_list
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18465
diff
changeset
|
525 | |
|
18473
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
526 | /** |
|
19016
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
527 | * Check whether 'crt' has a valid signature made by 'issuer' |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
528 | * |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
529 | * @param crt Certificate instance to check signature of |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
530 | * @param issuer Certificate thought to have signed 'crt' |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
531 | * |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
532 | * @return TRUE if 'crt' has a valid signature made by 'issuer', |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
533 | * otherwise FALSE |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
534 | * @todo Find a way to give the reason (bad signature, not the issuer, etc.) |
|
19016
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
535 | */ |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
536 | gboolean |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
537 | purple_certificate_signed_by(PurpleCertificate *crt, PurpleCertificate *issuer); |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
538 | |
|
3cf632c31eb3
- Add purple_certificate_signed_by
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19007
diff
changeset
|
539 | /** |
|
27936
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
540 | * Check that a certificate chain is valid and, if not, the failing certificate. |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
541 | * |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
542 | * Uses purple_certificate_signed_by() to verify that each PurpleCertificate |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
543 | * in the chain carries a valid signature from the next. A single-certificate |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
544 | * chain is considered to be valid. |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
545 | * |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
546 | * @param chain List of PurpleCertificate instances comprising the chain, |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
547 | * in the order certificate, issuer, issuer's issuer, etc. |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
548 | * @param failing A pointer to a PurpleCertificate*. If not NULL, if the |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
549 | * chain fails to validate, this will be set to the |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
550 | * certificate whose signature could not be validated. |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
551 | * @return TRUE if the chain is valid. See description. |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
552 | * |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
553 | * @since 2.6.0 |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
554 | * @deprecated This function will become |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
555 | * purple_certificate_check_signature_chain in 3.0.0 |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
556 | */ |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
557 | gboolean |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
558 | purple_certificate_check_signature_chain_with_failing(GList *chain, |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
559 | PurpleCertificate **failing); |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
560 | |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
561 | /** |
|
19017
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
562 | * Check that a certificate chain is valid |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
563 | * |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
564 | * Uses purple_certificate_signed_by() to verify that each PurpleCertificate |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
565 | * in the chain carries a valid signature from the next. A single-certificate |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
566 | * chain is considered to be valid. |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
567 | * |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
568 | * @param chain List of PurpleCertificate instances comprising the chain, |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
569 | * in the order certificate, issuer, issuer's issuer, etc. |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
570 | * @return TRUE if the chain is valid. See description. |
|
21002
37217acd474c
s/@TODO/@todo/ for Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
20940
diff
changeset
|
571 | * @todo Specify which certificate in the chain caused a failure |
|
27936
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
572 | * @deprecated This function will be removed in 3.0.0 and replaced with |
|
1763b40b18bd
Fix GnuTLS validation of the CACert Chain. Closes #4458.
Paul Aurich <darkrain42@pidgin.im>
parents:
25888
diff
changeset
|
573 | * purple_certificate_check_signature_chain_with_failing |
|
19017
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
574 | */ |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
575 | gboolean |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
576 | purple_certificate_check_signature_chain(GList *chain); |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
577 | |
|
d89f7930272f
- Add purple_certificate_check_signature_chain
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19016
diff
changeset
|
578 | /** |
|
18577
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
579 | * Imports a PurpleCertificate from a file |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
580 | * |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
581 | * @param scheme Scheme to import under |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
582 | * @param filename File path to import from |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
583 | * @return Pointer to a new PurpleCertificate, or NULL on failure |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
584 | */ |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
585 | PurpleCertificate * |
|
18578
95080ca9610a
- Fixed naming issues in previous revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18577
diff
changeset
|
586 | purple_certificate_import(PurpleCertificateScheme *scheme, const gchar *filename); |
|
18577
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
587 | |
|
7b4c95fb042d
- Add purple_certificate_import
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18573
diff
changeset
|
588 | /** |
|
29930
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
589 | * Imports a list of PurpleCertificates from a file |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
590 | * |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
591 | * @param scheme Scheme to import under |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
592 | * @param filename File path to import from |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
593 | * @return Pointer to a GSList of new PurpleCertificates, or NULL on failure |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
594 | */ |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
595 | GSList * |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
596 | purple_certificates_import(PurpleCertificateScheme *scheme, const gchar *filename); |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
597 | |
|
80f4616de5ce
Implement reading multiple certificates from a single "bundle" of
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
27936
diff
changeset
|
598 | /** |
|
18496
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
599 | * Exports a PurpleCertificate to a file |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
600 | * |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
601 | * @param filename File to export the certificate to |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
602 | * @param crt Certificate to export |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
603 | * @return TRUE if the export succeeded, otherwise FALSE |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
604 | */ |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
605 | gboolean |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
606 | purple_certificate_export(const gchar *filename, PurpleCertificate *crt); |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
607 | |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
608 | |
|
3bb8e716482e
- Add purple_certificate_export and associated libpurple stuff
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18494
diff
changeset
|
609 | /** |
|
18473
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
610 | * Retrieves the certificate public key fingerprint using SHA1. |
|
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
611 | * |
|
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
612 | * @param crt Certificate instance |
|
38214
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
613 | * @return Binary representation of the hash. You are responsible for freeing |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
614 | * this with g_byte_array_free(). |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
615 | * @see purple_base16_encode_chunked() |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
616 | * @see purple_certificate_get_fingerprint_sha256() |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
617 | */ |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
618 | GByteArray * |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
619 | purple_certificate_get_fingerprint_sha1(PurpleCertificate *crt); |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
620 | |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
621 | /** |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
622 | * Retrieves the certificate public key fingerprint using SHA256. |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
623 | * |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
624 | * @param crt Certificate instance |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
625 | * @param sha1_fallback If true, return SHA1 if the SSL module doesn't |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
626 | * implement SHA256. Otherwise, return NULL. |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
627 | * @return Binary representation of the hash. You are responsible for freeing |
|
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
628 | * this with g_byte_array_free(). |
|
18473
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
629 | * @see purple_base16_encode_chunked() |
|
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
630 | */ |
|
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
631 | GByteArray * |
|
38214
b3d0ba7c75f6
certificate: Use SHA256 fingerprints instead of SHA1
dx <dx@dxzone.com.ar>
parents:
36191
diff
changeset
|
632 | purple_certificate_get_fingerprint_sha256(PurpleCertificate *crt, gboolean sha1_fallback); |
|
18473
a7251d502f6a
- Add purple_certificate_get_fingerprint_sha1
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18472
diff
changeset
|
633 | |
|
19020
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
634 | /** |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
635 | * Get a unique identifier for the certificate |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
636 | * |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
637 | * @param crt Certificate instance |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
638 | * @return String representing the certificate uniquely. Must be g_free()'ed |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
639 | */ |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
640 | gchar * |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
641 | purple_certificate_get_unique_id(PurpleCertificate *crt); |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
642 | |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
643 | /** |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
644 | * Get a unique identifier for the certificate's issuer |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
645 | * |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
646 | * @param crt Certificate instance |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
647 | * @return String representing the certificate's issuer uniquely. Must be |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
648 | * g_free()'ed |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
649 | */ |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
650 | gchar * |
|
a9af8402bb04
- Expose get_unique_id and get_issuer_unique_id through libpurple functions
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19017
diff
changeset
|
651 | purple_certificate_get_issuer_unique_id(PurpleCertificate *crt); |
|
18481
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
652 | |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
653 | /** |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
654 | * Gets the certificate subject's name |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
655 | * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
656 | * For X.509, this is the "Common Name" field, as we're only using it |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
657 | * for hostname verification at the moment |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
658 | * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
659 | * @param crt Certificate instance |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
660 | * @return Newly allocated string with the certificate subject. |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
661 | */ |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
662 | gchar * |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
663 | purple_certificate_get_subject_name(PurpleCertificate *crt); |
|
d220d85caaf1
- Add purple_certificate_get_subject_name and associated libpurple
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18477
diff
changeset
|
664 | |
|
18643
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
665 | /** |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
666 | * Check the subject name against that on the certificate |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
667 | * @param crt Certificate instance |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
22396
diff
changeset
|
668 | * @param name Name to check. |
|
18643
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
669 | * @return TRUE if it is a match, else FALSE |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
670 | */ |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
671 | gboolean |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
672 | purple_certificate_check_subject_name(PurpleCertificate *crt, const gchar *name); |
|
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
673 | |
|
18647
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
674 | /** |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
675 | * Get the expiration/activation times. |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
676 | * |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
677 | * @param crt Certificate instance |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
678 | * @param activation Reference to store the activation time at. May be NULL |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
679 | * if you don't actually want it. |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
680 | * @param expiration Reference to store the expiration time at. May be NULL |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
681 | * if you don't actually want it. |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
682 | * @return TRUE if the requested values were obtained, otherwise FALSE. |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
683 | */ |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
684 | gboolean |
|
45240511f4eb
- Add expiration/activation functions for Certificates
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18646
diff
changeset
|
685 | purple_certificate_get_times(PurpleCertificate *crt, time_t *activation, time_t *expiration); |
|
18643
a6a86ac3c219
- Add certificate_check_subject_name and associated machinery
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18642
diff
changeset
|
686 | |
|
38216
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
687 | /** |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
688 | * Compares the public keys of two certificates. |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
689 | * |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
690 | * If the SSL backend does not implement this function, it may return FALSE |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
691 | * every time. This is the case with the NSS plugin, which doesn't need it. |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
692 | * |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
693 | * @param crt1 A certificate instance |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
694 | * @param crt2 Another certificate instance |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
695 | * @return TRUE if both certificates have the same key, otherwise FALSE |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
696 | * @since 2.12.0 |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
697 | */ |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
698 | gboolean |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
699 | purple_certificate_compare_pubkeys(PurpleCertificate *crt1, PurpleCertificate *crt2); |
|
887efbd652d8
certificate: Use public key fingerprint to compare certificates
dx <dx@dxzone.com.ar>
parents:
38214
diff
changeset
|
700 | |
|
18583
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
701 | /*@}*/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
702 | |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
703 | /*****************************************************************************/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
704 | /** @name Certificate Pool Functions */ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
705 | /*****************************************************************************/ |
|
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
706 | /*@{*/ |
|
18573
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
707 | /** |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
708 | * Helper function for generating file paths in ~/.purple/certificates for |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
709 | * CertificatePools that use them. |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
710 | * |
|
18645
805a3f4b259d
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18644
diff
changeset
|
711 | * All components will be escaped for filesystem friendliness. |
|
805a3f4b259d
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18644
diff
changeset
|
712 | * |
|
18573
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
713 | * @param pool CertificatePool to build a path for |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
714 | * @param id Key to look up a Certificate by. May be NULL. |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
715 | * @return A newly allocated path of the form |
|
18645
805a3f4b259d
- Fix overzealous escaping cause by ancestor revision
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18644
diff
changeset
|
716 | * ~/.purple/certificates/scheme_name/pool_name/unique_id |
|
18573
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
717 | */ |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
718 | gchar * |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
719 | purple_certificate_pool_mkpath(PurpleCertificatePool *pool, const gchar *id); |
|
c7fd4fbb4339
- Add purple_certificate_pool_mkpath helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18572
diff
changeset
|
720 | |
|
18584
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
721 | /** |
|
18818
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
722 | * Determines whether a pool can be used. |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
723 | * |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
724 | * Checks whether the associated CertificateScheme is loaded. |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
725 | * |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
726 | * @param pool Pool to check |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
727 | * |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
728 | * @return TRUE if the pool can be used, otherwise FALSE |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
729 | */ |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
730 | gboolean |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
731 | purple_certificate_pool_usable(PurpleCertificatePool *pool); |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
732 | |
|
6460aa4cfa41
- Add purple_certificate_pool_usable to check whether a pool's
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18663
diff
changeset
|
733 | /** |
|
19000
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
734 | * Looks up the scheme the pool operates under |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
735 | * |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
736 | * @param pool Pool to get the scheme of |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
737 | * |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
738 | * @return Pointer to the pool's scheme, or NULL if it isn't loaded. |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
739 | * @see purple_certificate_pool_usable() |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
740 | */ |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
741 | PurpleCertificateScheme * |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
742 | purple_certificate_pool_get_scheme(PurpleCertificatePool *pool); |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
743 | |
|
ec4a9c38e415
- Add purple_certificate_pool_get_scheme helper function
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18899
diff
changeset
|
744 | /** |
|
18584
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
745 | * Check for presence of an ID in a pool. |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
746 | * @param pool Pool to look in |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
747 | * @param id ID to look for |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
748 | * @return TRUE if the ID is in the pool, else FALSE |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
749 | */ |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
750 | gboolean |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
751 | purple_certificate_pool_contains(PurpleCertificatePool *pool, const gchar *id); |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
752 | |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
753 | /** |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
754 | * Retrieve a certificate from a pool. |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
755 | * @param pool Pool to fish in |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
756 | * @param id ID to look up |
|
36144
33c30c4b33b4
Clarify docs - the PurpleCertificate from purple_certificate_pool_retrieve must
Daniel Atallah <datallah@pidgin.im>
parents:
29930
diff
changeset
|
757 | * @return Retrieved certificate (to be freed with purple_certificate_destroy), |
|
33c30c4b33b4
Clarify docs - the PurpleCertificate from purple_certificate_pool_retrieve must
Daniel Atallah <datallah@pidgin.im>
parents:
29930
diff
changeset
|
758 | * or NULL if it wasn't there |
|
18584
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
759 | */ |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
760 | PurpleCertificate * |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
761 | purple_certificate_pool_retrieve(PurpleCertificatePool *pool, const gchar *id); |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
762 | |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
763 | /** |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
764 | * Add a certificate to a pool |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
765 | * |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
766 | * Any pre-existing certificate of the same ID will be overwritten. |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
767 | * |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
768 | * @param pool Pool to add to |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
769 | * @param id ID to store the certificate with |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
770 | * @param crt Certificate to store |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
771 | * @return TRUE if the operation succeeded, otherwise FALSE |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
772 | */ |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
773 | gboolean |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
774 | purple_certificate_pool_store(PurpleCertificatePool *pool, const gchar *id, PurpleCertificate *crt); |
|
d4410000050f
- Add pool retrieve, contains, and store functions to certificate API
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18583
diff
changeset
|
775 | |
|
18661
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
776 | /** |
|
18899
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
777 | * Remove a certificate from a pool |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
778 | * |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
779 | * @param pool Pool to remove from |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
780 | * @param id ID to remove |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
781 | * @return TRUE if the operation succeeded, otherwise FALSE |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
782 | */ |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
783 | gboolean |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
784 | purple_certificate_pool_delete(PurpleCertificatePool *pool, const gchar *id); |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
785 | |
|
45bdab2558f8
- Add purple_certificate_pool_delete
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18818
diff
changeset
|
786 | /** |
|
18661
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
787 | * Get the list of IDs currently in the pool. |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
788 | * |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
789 | * @param pool Pool to enumerate |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
790 | * @return GList pointing to newly-allocated id strings. Free using |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
791 | * purple_certificate_pool_destroy_idlist() |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
792 | */ |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
793 | GList * |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
794 | purple_certificate_pool_get_idlist(PurpleCertificatePool *pool); |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
795 | |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
796 | /** |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
797 | * Destroys the result given by purple_certificate_pool_get_idlist() |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
798 | * |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
799 | * @param idlist ID List to destroy |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
800 | */ |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
801 | void |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
802 | purple_certificate_pool_destroy_idlist(GList *idlist); |
|
a3c1e2719e45
- Add pool_get_idlist / pool_destroy_idlist
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18658
diff
changeset
|
803 | |
|
18465
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
804 | /*@}*/ |
|
e3f061608f7b
- Documentation segmentation
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18462
diff
changeset
|
805 | |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
806 | /*****************************************************************************/ |
|
18583
a3e6934ba7a8
- Rearrange certificate.h for better organization
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18578
diff
changeset
|
807 | /** @name Certificate Subsystem API */ |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
808 | /*****************************************************************************/ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
809 | /*@{*/ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
810 | |
|
18470
6a1deea19882
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18467
diff
changeset
|
811 | /** |
|
18477
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
812 | * Initialize the certificate system |
|
18470
6a1deea19882
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18467
diff
changeset
|
813 | */ |
|
6a1deea19882
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18467
diff
changeset
|
814 | void |
|
18477
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
815 | purple_certificate_init(void); |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
816 | |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
817 | /** |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
818 | * Un-initialize the certificate system |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
819 | */ |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
820 | void |
|
47243c0d52c6
- Certificate system now has init and uninit like other systems
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18473
diff
changeset
|
821 | purple_certificate_uninit(void); |
|
18470
6a1deea19882
- Add purple_certificate_register_builtins
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18467
diff
changeset
|
822 | |
|
18657
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
823 | /** |
|
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
824 | * Get the Certificate subsystem handle for signalling purposes |
|
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
825 | */ |
|
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
826 | gpointer |
|
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
827 | purple_certificate_get_handle(void); |
|
4932aaf945ea
- Add purple_certificate_get_handle
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18656
diff
changeset
|
828 | |
|
18251
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
829 | /** Look up a registered CertificateScheme by name |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
830 | * @param name The scheme name. Case insensitive. |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
831 | * @return Pointer to the located Scheme, or NULL if it isn't found. |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
832 | */ |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
833 | PurpleCertificateScheme * |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
834 | purple_certificate_find_scheme(const gchar *name); |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
835 | |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
836 | /** |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
837 | * Get all registered CertificateSchemes |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
838 | * |
|
18663
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
839 | * @return GList pointing to all registered CertificateSchemes . This value |
|
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
840 | * is owned by libpurple |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
841 | */ |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
842 | GList * |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
843 | purple_certificate_get_schemes(void); |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
844 | |
|
18251
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
845 | /** Register a CertificateScheme with libpurple |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
846 | * |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
847 | * No two schemes can be registered with the same name; this function enforces |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
848 | * that. |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
849 | * |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
850 | * @param scheme Pointer to the scheme to register. |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
851 | * @return TRUE if the scheme was successfully added, otherwise FALSE |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
852 | */ |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
853 | gboolean |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
854 | purple_certificate_register_scheme(PurpleCertificateScheme *scheme); |
|
41e00264c49d
- Add chunks of the certificate scheme registration interface
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18249
diff
changeset
|
855 | |
|
18446
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
856 | /** Unregister a CertificateScheme from libpurple |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
857 | * |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
858 | * @param scheme Scheme to unregister. |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
859 | * If the scheme is not registered, this is a no-op. |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
860 | * |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
861 | * @return TRUE if the unregister completed successfully |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
862 | */ |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
863 | gboolean |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
864 | purple_certificate_unregister_scheme(PurpleCertificateScheme *scheme); |
|
3e79caab7088
- Add unregister_scheme
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18251
diff
changeset
|
865 | |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
866 | /** Look up a registered PurpleCertificateVerifier by scheme and name |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
867 | * @param scheme_name Scheme name. Case insensitive. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
868 | * @param ver_name The verifier name. Case insensitive. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
869 | * @return Pointer to the located Verifier, or NULL if it isn't found. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
870 | */ |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
871 | PurpleCertificateVerifier * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
872 | purple_certificate_find_verifier(const gchar *scheme_name, const gchar *ver_name); |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
873 | |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
874 | /** |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
875 | * Get the list of registered CertificateVerifiers |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
876 | * |
|
18663
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
877 | * @return GList of all registered PurpleCertificateVerifier. This value |
|
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
878 | * is owned by libpurple |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
879 | */ |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
880 | GList * |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
881 | purple_certificate_get_verifiers(void); |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
882 | |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
883 | /** |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
884 | * Register a CertificateVerifier with libpurple |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
885 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
886 | * @param vr Verifier to register. |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
887 | * @return TRUE if register succeeded, otherwise FALSE |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
888 | */ |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
889 | gboolean |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
890 | purple_certificate_register_verifier(PurpleCertificateVerifier *vr); |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
891 | |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
892 | /** |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
893 | * Unregister a CertificateVerifier with libpurple |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
894 | * |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
895 | * @param vr Verifier to unregister. |
|
18490
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
896 | * @return TRUE if unregister succeeded, otherwise FALSE |
|
18461
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
897 | */ |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
898 | gboolean |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
899 | purple_certificate_unregister_verifier(PurpleCertificateVerifier *vr); |
|
8ae1cd456532
- CertificateVerifier register/unregister/find
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18460
diff
changeset
|
900 | |
|
18490
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
901 | /** Look up a registered PurpleCertificatePool by scheme and name |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
902 | * @param scheme_name Scheme name. Case insensitive. |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
903 | * @param pool_name Pool name. Case insensitive. |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
904 | * @return Pointer to the located Pool, or NULL if it isn't found. |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
905 | */ |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
906 | PurpleCertificatePool * |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
907 | purple_certificate_find_pool(const gchar *scheme_name, const gchar *pool_name); |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
908 | |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
909 | /** |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
910 | * Get the list of registered Pools |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
911 | * |
|
18663
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
912 | * @return GList of all registered PurpleCertificatePool s. This value |
|
4b8a5bbdba2b
- Add dire warnings to the purple_certificate_get_Xs docs
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18661
diff
changeset
|
913 | * is owned by libpurple |
|
18658
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
914 | */ |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
915 | GList * |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
916 | purple_certificate_get_pools(void); |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
917 | |
|
2cc5bc32898a
- Add get_pools, get_verifiers, and get_schemes
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18657
diff
changeset
|
918 | /** |
|
18490
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
919 | * Register a CertificatePool with libpurple and call its init function |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
920 | * |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
921 | * @param pool Pool to register. |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
922 | * @return TRUE if the register succeeded, otherwise FALSE |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
923 | */ |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
924 | gboolean |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
925 | purple_certificate_register_pool(PurpleCertificatePool *pool); |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
926 | |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
927 | /** |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
928 | * Unregister a CertificatePool with libpurple and call its uninit function |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
929 | * |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
930 | * @param pool Pool to unregister. |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
931 | * @return TRUE if the unregister succeeded, otherwise FALSE |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
932 | */ |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
933 | gboolean |
|
691b0b16f8be
- Add find, register, and unregister for CertificatePools
William Ehlhardt <williamehlhardt@gmail.com>
parents:
18489
diff
changeset
|
934 | purple_certificate_unregister_pool(PurpleCertificatePool *pool); |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
935 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
936 | /*@}*/ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
937 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
938 | |
|
19489
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
939 | /** |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
940 | * Displays a window showing X.509 certificate information |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
941 | * |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
942 | * @param crt Certificate under an "x509" Scheme |
|
21002
37217acd474c
s/@TODO/@todo/ for Doxygen.
Richard Laager <rlaager@pidgin.im>
parents:
20940
diff
changeset
|
943 | * @todo Will break on CA certs, as they have no Common Name |
|
19489
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
944 | */ |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
945 | void |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
946 | purple_certificate_display_x509(PurpleCertificate *crt); |
|
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
947 | |
|
22001
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
948 | /** |
|
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
949 | * Add a search path for certificates. |
|
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
950 | * |
|
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
951 | * @param path Path to search for certificates. |
|
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
952 | */ |
|
80abe994a8f3
Patch from Florian Quèze (the InstantBird dude) to add a search path for
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21002
diff
changeset
|
953 | void purple_certificate_add_ca_search_path(const char *path); |
|
19489
772b691e901b
- Add purple_certificate_display_x509
William Ehlhardt <williamehlhardt@gmail.com>
parents:
19032
diff
changeset
|
954 | |
|
17506
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
955 | #ifdef __cplusplus |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
956 | } |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
957 | #endif /* __cplusplus */ |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
958 | |
|
eff6bdd382f3
- Added certificate.[ch] and got them integrated into the build
William Ehlhardt <williamehlhardt@gmail.com>
parents:
diff
changeset
|
959 | #endif /* _PURPLE_CERTIFICATE_H */ |