Coverage Report

Created: 2024-06-20 06:28

/src/gnutls/lib/x509/x509_int.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2003-2012 Free Software Foundation, Inc.
3
 * Copyright (C) 2017 Red Hat, Inc.
4
 *
5
 * Author: Nikos Mavrogiannopoulos
6
 *
7
 * This file is part of GnuTLS.
8
 *
9
 * The GnuTLS is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU Lesser General Public License
11
 * as published by the Free Software Foundation; either version 2.1 of
12
 * the License, or (at your option) any later version.
13
 *
14
 * This library is distributed in the hope that it will be useful, but
15
 * WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17
 * Lesser General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU Lesser General Public License
20
 * along with this program.  If not, see <https://www.gnu.org/licenses/>
21
 *
22
 */
23
24
#ifndef GNUTLS_LIB_X509_X509_INT_H
25
#define GNUTLS_LIB_X509_X509_INT_H
26
27
#include <gnutls/x509.h>
28
#include <gnutls/x509-ext.h>
29
#include <gnutls/abstract.h>
30
31
#include <libtasn1.h>
32
33
#define MAX_CRQ_EXTENSIONS_SIZE 8 * 1024
34
#define MAX_OID_SIZE 128
35
#define MAX_KEY_ID_SIZE 128
36
#define MAX_SALT_SIZE 256
37
#define MAX_NAME_SIZE (3 * ASN1_MAX_NAME_SIZE)
38
39
#define HASH_OID_SHA1 "1.3.14.3.2.26"
40
#define HASH_OID_MD5 "1.2.840.113549.2.5"
41
#define HASH_OID_MD2 "1.2.840.113549.2.2"
42
#define HASH_OID_RMD160 "1.3.36.3.2.1"
43
#define HASH_OID_SHA224 "2.16.840.1.101.3.4.2.4"
44
#define HASH_OID_SHA256 "2.16.840.1.101.3.4.2.1"
45
#define HASH_OID_SHA384 "2.16.840.1.101.3.4.2.2"
46
#define HASH_OID_SHA512 "2.16.840.1.101.3.4.2.3"
47
#define HASH_OID_SHA3_224 "2.16.840.1.101.3.4.2.7"
48
#define HASH_OID_SHA3_256 "2.16.840.1.101.3.4.2.8"
49
#define HASH_OID_SHA3_384 "2.16.840.1.101.3.4.2.9"
50
#define HASH_OID_SHA3_512 "2.16.840.1.101.3.4.2.10"
51
#define HASH_OID_SHAKE_128 "2.16.840.1.101.3.4.2.11"
52
#define HASH_OID_SHAKE_256 "2.16.840.1.101.3.4.2.12"
53
#define HASH_OID_GOST_R_3411_94 "1.2.643.2.2.9"
54
0
#define HASH_OID_STREEBOG_256 "1.2.643.7.1.1.2.2"
55
0
#define HASH_OID_STREEBOG_512 "1.2.643.7.1.1.2.3"
56
57
0
#define HASH_OID_GOST_R_3411_94_CRYPTOPRO_PARAMS "1.2.643.2.2.30.1"
58
59
/* from rfc8479 */
60
0
#define OID_ATTR_PROV_SEED "1.3.6.1.4.1.2312.18.8.1"
61
62
struct gnutls_x509_crl_iter {
63
  /* This is used to optimize reads by gnutls_x509_crl_iter_crt_serial() */
64
  asn1_node rcache;
65
  unsigned rcache_idx;
66
};
67
68
typedef struct gnutls_x509_crl_int {
69
  asn1_node crl;
70
71
  unsigned expanded;
72
  /* This is used to optimize reads by gnutls_x509_crl_get_crt_serial2() */
73
  asn1_node rcache;
74
  unsigned rcache_idx;
75
  int use_extensions;
76
77
  gnutls_datum_t der;
78
  gnutls_datum_t raw_issuer_dn;
79
} gnutls_x509_crl_int;
80
81
typedef struct gnutls_x509_dn_st {
82
  asn1_node asn;
83
} gnutls_x509_dn_st;
84
85
typedef struct gnutls_x509_crt_int {
86
  asn1_node cert;
87
  int use_extensions;
88
  unsigned expanded; /* a certificate has been expanded */
89
  unsigned modified; /* the cached values below may no longer be valid */
90
  unsigned flags;
91
92
  struct pin_info_st pin;
93
94
  /* These two cached values allow fast calls to
95
   * get_raw_*_dn(). */
96
  gnutls_datum_t raw_dn;
97
  gnutls_datum_t raw_issuer_dn;
98
  gnutls_datum_t raw_spki;
99
100
  gnutls_datum_t der;
101
102
  /* this cached value allows fast access to alt names */
103
  gnutls_subject_alt_names_t san;
104
  gnutls_subject_alt_names_t ian;
105
106
  /* backwards compatibility for gnutls_x509_crt_get_subject()
107
   * and gnutls_x509_crt_get_issuer() */
108
  gnutls_x509_dn_st dn;
109
  gnutls_x509_dn_st idn;
110
} gnutls_x509_crt_int;
111
112
0
#define MODIFIED(crt) crt->modified = 1
113
114
typedef struct gnutls_x509_crq_int {
115
  asn1_node crq;
116
} gnutls_x509_crq_int;
117
118
typedef struct gnutls_pkcs7_attrs_st {
119
  char *oid;
120
  gnutls_datum_t data;
121
  struct gnutls_pkcs7_attrs_st *next;
122
} gnutls_pkcs7_attrs_st;
123
124
typedef struct gnutls_pkcs7_int {
125
  asn1_node pkcs7;
126
127
  char encap_data_oid[MAX_OID_SIZE];
128
129
  gnutls_datum_t der_signed_data;
130
  asn1_node signed_data;
131
  unsigned expanded;
132
} gnutls_pkcs7_int;
133
134
struct pbkdf2_params {
135
  uint8_t salt[MAX_SALT_SIZE];
136
  int salt_size;
137
  unsigned iter_count;
138
  unsigned key_size;
139
  gnutls_mac_algorithm_t mac;
140
};
141
142
typedef struct gnutls_x509_privkey_int {
143
  /* the size of params depends on the public
144
   * key algorithm
145
   */
146
  gnutls_pk_params_st params;
147
148
  unsigned expanded;
149
  unsigned flags;
150
151
  asn1_node key;
152
  struct pin_info_st pin;
153
} gnutls_x509_privkey_int;
154
155
int _gnutls_x509_crt_cpy(gnutls_x509_crt_t dest, gnutls_x509_crt_t src);
156
157
int _gnutls_x509_compare_raw_dn(const gnutls_datum_t *dn1,
158
        const gnutls_datum_t *dn2);
159
160
int _gnutls_x509_crl_cpy(gnutls_x509_crl_t dest, gnutls_x509_crl_t src);
161
int _gnutls_x509_crl_get_raw_issuer_dn(gnutls_x509_crl_t crl,
162
               gnutls_datum_t *dn);
163
164
/* sign.c */
165
int _gnutls_x509_get_tbs(asn1_node cert, const char *tbs_name,
166
       gnutls_datum_t *tbs);
167
int _gnutls_x509_pkix_sign(asn1_node src, const char *src_name,
168
         gnutls_digest_algorithm_t, unsigned int flags,
169
         gnutls_x509_crt_t issuer,
170
         gnutls_privkey_t issuer_key);
171
int _gnutls_x509_crt_get_spki_params(gnutls_x509_crt_t issuer,
172
             const gnutls_x509_spki_st *key_params,
173
             gnutls_x509_spki_st *params);
174
175
0
#define map_errs_to_zero(x) ((x) < 0 ? 0 : (x))
176
177
/* dn.c */
178
#define OID_X520_COUNTRY_NAME "2.5.4.6"
179
#define OID_X520_ORGANIZATION_NAME "2.5.4.10"
180
#define OID_X520_ORGANIZATIONAL_UNIT_NAME "2.5.4.11"
181
0
#define OID_X520_COMMON_NAME "2.5.4.3"
182
#define OID_X520_LOCALITY_NAME "2.5.4.7"
183
#define OID_X520_STATE_OR_PROVINCE_NAME "2.5.4.8"
184
#define OID_LDAP_DC "0.9.2342.19200300.100.1.25"
185
#define OID_LDAP_UID "0.9.2342.19200300.100.1.1"
186
#define OID_PKCS9_EMAIL "1.2.840.113549.1.9.1"
187
188
int _gnutls_x509_parse_dn(asn1_node asn1_struct, const char *asn1_rdn_name,
189
        char *buf, size_t *sizeof_buf, unsigned flags);
190
191
int _gnutls_x509_get_dn(asn1_node asn1_struct, const char *asn1_rdn_name,
192
      gnutls_datum_t *dn, unsigned flags);
193
194
int _gnutls_x509_parse_dn_oid(asn1_node asn1_struct, const char *asn1_rdn_name,
195
            const char *given_oid, int indx,
196
            unsigned int raw_flag, gnutls_datum_t *out);
197
198
int _gnutls_x509_set_dn_oid(asn1_node asn1_struct, const char *asn1_rdn_name,
199
          const char *oid, int raw_flag, const char *name,
200
          int sizeof_name);
201
202
int _gnutls_x509_get_dn_oid(asn1_node asn1_struct, const char *asn1_rdn_name,
203
          int indx, void *_oid, size_t *sizeof_oid);
204
205
int _gnutls_encode_othername_data(unsigned flags, const void *data,
206
          unsigned data_size, gnutls_datum_t *output);
207
208
int _gnutls_parse_general_name(asn1_node src, const char *src_name, int seq,
209
             void *name, size_t *name_size,
210
             unsigned int *ret_type, int othername_oid);
211
212
int _gnutls_parse_general_name2(asn1_node src, const char *src_name, int seq,
213
        gnutls_datum_t *dname, unsigned int *ret_type,
214
        int othername_oid);
215
216
int _gnutls_write_new_general_name(asn1_node ext, const char *ext_name,
217
           gnutls_x509_subject_alt_name_t type,
218
           const void *data, unsigned int data_size);
219
220
int _gnutls_write_new_othername(asn1_node ext, const char *ext_name,
221
        const char *oid, const void *data,
222
        unsigned int data_size);
223
224
/* dsa.c */
225
226
/* verify.c */
227
int gnutls_x509_crt_is_issuer(gnutls_x509_crt_t cert, gnutls_x509_crt_t issuer);
228
229
int _gnutls_x509_verify_algorithm(gnutls_digest_algorithm_t *hash,
230
          const gnutls_datum_t *signature,
231
          gnutls_pk_algorithm_t pk,
232
          gnutls_pk_params_st *issuer_params);
233
234
/* privkey.h */
235
void _gnutls_x509_privkey_reinit(gnutls_x509_privkey_t key);
236
237
asn1_node _gnutls_privkey_decode_pkcs1_rsa_key(const gnutls_datum_t *raw_key,
238
                 gnutls_x509_privkey_t pkey);
239
int _gnutls_privkey_decode_ecc_key(asn1_node *pkey_asn,
240
           const gnutls_datum_t *raw_key,
241
           gnutls_x509_privkey_t pkey,
242
           gnutls_ecc_curve_t curve);
243
244
int _gnutls_privkey_decode_eddsa_key(asn1_node *pkey_asn,
245
             const gnutls_datum_t *raw_key,
246
             gnutls_x509_privkey_t pkey,
247
             gnutls_ecc_curve_t curve);
248
249
int _gnutls_x509_read_ecc_params(uint8_t *der, int dersize,
250
         unsigned int *curve);
251
252
int _gnutls_x509_read_gost_params(uint8_t *der, int dersize,
253
          gnutls_pk_params_st *params,
254
          gnutls_pk_algorithm_t algo);
255
256
int _gnutls_asn1_encode_privkey(asn1_node *c2, gnutls_pk_params_st *params);
257
258
void _gnutls_x509_privkey_get_spki_params(gnutls_x509_privkey_t key,
259
            gnutls_x509_spki_st *params);
260
261
int _gnutls_x509_read_rsa_pss_params(uint8_t *der, int dersize,
262
             gnutls_x509_spki_st *params);
263
int _gnutls_x509_write_rsa_pss_params(const gnutls_x509_spki_st *params,
264
              gnutls_datum_t *der);
265
266
/* extensions.c */
267
int _gnutls_x509_crl_get_extension_oid(gnutls_x509_crl_t crl, int indx,
268
               void *oid, size_t *sizeof_oid);
269
270
int _gnutls_x509_crl_set_extension(gnutls_x509_crl_t crl, const char *ext_id,
271
           const gnutls_datum_t *ext_data,
272
           unsigned int critical);
273
274
int _gnutls_x509_crl_get_extension(gnutls_x509_crl_t crl,
275
           const char *extension_id, int indx,
276
           gnutls_datum_t *data,
277
           unsigned int *critical);
278
279
int _gnutls_x509_crt_get_extension(gnutls_x509_crt_t cert,
280
           const char *extension_id, int indx,
281
           gnutls_datum_t *data,
282
           unsigned int *critical);
283
284
int _gnutls_x509_crt_get_extension_oid(gnutls_x509_crt_t cert, int indx,
285
               void *ret, size_t *ret_size);
286
int _gnutls_x509_crt_set_extension(gnutls_x509_crt_t cert,
287
           const char *extension_id,
288
           const gnutls_datum_t *ext_data,
289
           unsigned int critical);
290
291
int _gnutls_x509_ext_extract_number(uint8_t *number, size_t *nr_size,
292
            uint8_t *extnValue, int extnValueLen);
293
int _gnutls_x509_ext_gen_number(const uint8_t *number, size_t nr_size,
294
        gnutls_datum_t *der_ext);
295
296
int _gnutls_write_general_name(asn1_node ext, const char *ext_name,
297
             gnutls_x509_subject_alt_name_t type,
298
             const void *data, unsigned int data_size);
299
300
int _gnutls_x509_ext_gen_subject_alt_name(gnutls_x509_subject_alt_name_t type,
301
            const char *othername_oid,
302
            const void *data,
303
            unsigned int data_size,
304
            const gnutls_datum_t *prev_der_ext,
305
            gnutls_datum_t *der_ext);
306
int _gnutls_x509_ext_gen_auth_key_id(const void *id, size_t id_size,
307
             gnutls_datum_t *der_data);
308
309
/* mpi.c */
310
int _gnutls_x509_crq_get_mpis(gnutls_x509_crq_t cert, gnutls_pk_params_st *);
311
312
int _gnutls_x509_crt_get_mpis(gnutls_x509_crt_t cert,
313
            gnutls_pk_params_st *params);
314
315
int _gnutls_x509_read_pubkey_params(gnutls_pk_algorithm_t, uint8_t *der,
316
            int dersize, gnutls_pk_params_st *params);
317
int _gnutls_x509_check_pubkey_params(gnutls_pk_params_st *params);
318
319
int _gnutls_x509_read_pubkey(gnutls_pk_algorithm_t, uint8_t *der, int dersize,
320
           gnutls_pk_params_st *params);
321
322
int _gnutls_x509_read_pubkey_signature_params(gnutls_pk_algorithm_t algo,
323
                uint8_t *der, int dersize,
324
                gnutls_pk_params_st *params);
325
326
int _gnutls_x509_write_ecc_params(const gnutls_ecc_curve_t curve,
327
          gnutls_datum_t *der);
328
int _gnutls_x509_write_ecc_pubkey(const gnutls_pk_params_st *params,
329
          gnutls_datum_t *der);
330
331
int _gnutls_x509_write_eddsa_pubkey(const gnutls_pk_params_st *params,
332
            gnutls_datum_t *der);
333
334
int _gnutls_x509_write_pubkey_params(const gnutls_pk_params_st *params,
335
             gnutls_datum_t *der);
336
int _gnutls_x509_write_pubkey(const gnutls_pk_params_st *params,
337
            gnutls_datum_t *der);
338
339
int _gnutls_x509_read_uint(asn1_node node, const char *value,
340
         unsigned int *ret);
341
342
int _gnutls_x509_read_der_int(uint8_t *der, int dersize, bigint_t *out);
343
int _gnutls_x509_read_der_uint(uint8_t *der, int dersize, unsigned int *out);
344
345
int _gnutls_x509_read_int(asn1_node node, const char *value, bigint_t *ret_mpi);
346
int _gnutls_x509_write_int(asn1_node node, const char *value, bigint_t mpi,
347
         int lz);
348
349
int _gnutls_x509_write_uint32(asn1_node node, const char *value, uint32_t num);
350
351
int _gnutls_x509_read_key_int(asn1_node node, const char *value,
352
            bigint_t *ret_mpi);
353
int _gnutls_x509_write_key_int(asn1_node node, const char *value, bigint_t mpi,
354
             int lz);
355
356
int _gnutls_x509_read_key_int_le(asn1_node node, const char *value,
357
         bigint_t *ret_mpi);
358
int _gnutls_x509_write_key_int_le(asn1_node node, const char *value,
359
          bigint_t mpi);
360
361
int _gnutls_x509_read_pkalgo_params(asn1_node src, const char *src_name,
362
            gnutls_x509_spki_st *params,
363
            unsigned is_sig);
364
int _gnutls_x509_write_sign_params(asn1_node dst, const char *dst_name,
365
           const gnutls_sign_entry_st *se,
366
           gnutls_x509_spki_st *params);
367
368
#define _gnutls_x509_read_sign_params(src, name, params) \
369
0
  _gnutls_x509_read_pkalgo_params(src, name, params, 1)
370
#define _gnutls_x509_read_spki_params(src, name, params) \
371
0
  _gnutls_x509_read_pkalgo_params(src, name, params, 0)
372
int _gnutls_x509_write_spki_params(asn1_node dst, const char *dst_name,
373
           gnutls_x509_spki_st *params);
374
375
inline static int _gnutls_x509_crt_read_spki_params(gnutls_x509_crt_t crt,
376
                gnutls_x509_spki_st *params)
377
0
{
378
0
  return _gnutls_x509_read_spki_params(crt->cert,
379
0
               "tbsCertificate."
380
0
               "subjectPublicKeyInfo."
381
0
               "algorithm",
382
0
               params);
383
0
}
Unexecuted instantiation: ciphers.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: mac.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: mpi.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: profiles.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: state.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: cert-session.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: ocsp-api.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: ocsp.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: output.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: time.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: tls_features.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: verify-high.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: verify.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: virt-san.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: x509.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: x509_ext.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: key_share.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: post_handshake.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: status_request.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: supported_groups.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: cert.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: cert_types.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: ciphersuites.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: ecc.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: groups.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: kx.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: protocols.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: publickey.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: secparams.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: sign.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pk.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: handshake-tls13.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: handshake.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: auth.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: session_pack.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: cert-cred.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: fingerprint.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: tls-sig.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: cert-cred-x509.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: privkey.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pcert.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pubkey.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: dh-session.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: handshake-checks.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: certificate_request.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: certificate_verify.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: tls13-sig.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: hello_retry.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: session_ticket.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: certificate.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: common.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: crl.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: crq.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: dn.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: email-verify.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: extensions.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: hostname-verify.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: key_decode.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: key_encode.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: krb5.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: name_constraints.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pkcs12.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pkcs12_bag.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pkcs12_encr.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: pkcs7-crypt.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: privkey_openssl.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: privkey_pkcs8.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: privkey_pkcs8_pbes1.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: prov-seed.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: verify-high2.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: x509_dn.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: x509_write.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: dhe.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: ecdhe.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: rsa.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: rsa_psk.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: vko_gost.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: dh.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: vko.c:_gnutls_x509_crt_read_spki_params
Unexecuted instantiation: attributes.c:_gnutls_x509_crt_read_spki_params
384
385
inline static int _gnutls_x509_crq_read_spki_params(gnutls_x509_crq_t crt,
386
                gnutls_x509_spki_st *params)
387
0
{
388
0
  return _gnutls_x509_read_spki_params(crt->crq,
389
0
               "certificationRequestInfo."
390
0
               "subjectPKInfo."
391
0
               "algorithm",
392
0
               params);
393
0
}
Unexecuted instantiation: ciphers.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: mac.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: mpi.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: profiles.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: state.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: cert-session.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: ocsp-api.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: ocsp.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: output.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: time.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: tls_features.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: verify-high.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: verify.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: virt-san.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: x509.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: x509_ext.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: key_share.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: post_handshake.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: status_request.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: supported_groups.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: cert.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: cert_types.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: ciphersuites.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: ecc.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: groups.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: kx.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: protocols.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: publickey.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: secparams.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: sign.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pk.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: handshake-tls13.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: handshake.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: auth.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: session_pack.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: cert-cred.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: fingerprint.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: tls-sig.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: cert-cred-x509.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: privkey.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pcert.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pubkey.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: dh-session.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: handshake-checks.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: certificate_request.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: certificate_verify.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: tls13-sig.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: hello_retry.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: session_ticket.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: certificate.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: common.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: crl.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: crq.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: dn.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: email-verify.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: extensions.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: hostname-verify.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: key_decode.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: key_encode.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: krb5.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: name_constraints.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pkcs12.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pkcs12_bag.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pkcs12_encr.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: pkcs7-crypt.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: privkey_openssl.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: privkey_pkcs8.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: privkey_pkcs8_pbes1.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: prov-seed.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: verify-high2.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: x509_dn.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: x509_write.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: dhe.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: ecdhe.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: rsa.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: rsa_psk.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: vko_gost.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: dh.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: vko.c:_gnutls_x509_crq_read_spki_params
Unexecuted instantiation: attributes.c:_gnutls_x509_crq_read_spki_params
394
395
/* pkcs12.h */
396
#include <gnutls/pkcs12.h>
397
398
typedef struct gnutls_pkcs12_int {
399
  asn1_node pkcs12;
400
  unsigned expanded;
401
} gnutls_pkcs12_int;
402
403
0
#define MAX_BAG_ELEMENTS 32
404
405
struct bag_element {
406
  gnutls_datum_t data;
407
  gnutls_pkcs12_bag_type_t type;
408
  gnutls_datum_t local_key_id;
409
  char *friendly_name;
410
};
411
412
typedef struct gnutls_pkcs12_bag_int {
413
  struct bag_element element[MAX_BAG_ELEMENTS];
414
  unsigned bag_elements;
415
} gnutls_pkcs12_bag_int;
416
417
0
#define BAG_PKCS8_KEY "1.2.840.113549.1.12.10.1.1"
418
0
#define BAG_PKCS8_ENCRYPTED_KEY "1.2.840.113549.1.12.10.1.2"
419
0
#define BAG_CERTIFICATE "1.2.840.113549.1.12.10.1.3"
420
0
#define BAG_CRL "1.2.840.113549.1.12.10.1.4"
421
0
#define BAG_SECRET "1.2.840.113549.1.12.10.1.5"
422
423
/* Bag attributes
424
 */
425
0
#define FRIENDLY_NAME_OID "1.2.840.113549.1.9.20"
426
0
#define KEY_ID_OID "1.2.840.113549.1.9.21"
427
428
int _gnutls_pkcs12_string_to_key(const mac_entry_st *me, unsigned int id,
429
         const uint8_t *salt, unsigned int salt_size,
430
         unsigned int iter, const char *pw,
431
         unsigned int req_keylen, uint8_t *keybuf);
432
433
int _pkcs12_decode_safe_contents(const gnutls_datum_t *content,
434
         gnutls_pkcs12_bag_t bag);
435
436
int _pkcs12_encode_safe_contents(gnutls_pkcs12_bag_t bag, asn1_node *content,
437
         int *enc);
438
439
int _pkcs12_decode_crt_bag(gnutls_pkcs12_bag_type_t type,
440
         const gnutls_datum_t *in, gnutls_datum_t *out);
441
int _pkcs12_encode_crt_bag(gnutls_pkcs12_bag_type_t type,
442
         const gnutls_datum_t *raw, gnutls_datum_t *out);
443
444
/* crq */
445
int _gnutls_x509_crq_set_extension(gnutls_x509_crq_t crq, const char *ext_id,
446
           const gnutls_datum_t *ext_data,
447
           unsigned int critical);
448
449
int gnutls_x509_crt_verify_data3(gnutls_x509_crt_t crt,
450
         gnutls_sign_algorithm_t algo,
451
         gnutls_typed_vdata_st *vdata,
452
         unsigned int vdata_size,
453
         const gnutls_datum_t *data,
454
         const gnutls_datum_t *signature,
455
         unsigned int flags);
456
457
int _gnutls_trust_list_get_issuer(gnutls_x509_trust_list_t list,
458
          gnutls_x509_crt_t cert,
459
          gnutls_x509_crt_t *issuer,
460
          unsigned int flags);
461
462
unsigned int _gnutls_verify_crt_status(
463
  gnutls_x509_trust_list_t tlist,
464
  const gnutls_x509_crt_t *certificate_list, int clist_size,
465
  const gnutls_x509_crt_t *trusted_cas, int tcas_size, unsigned int flags,
466
  const char *purpose, gnutls_verify_output_function func);
467
468
#ifdef ENABLE_PKCS11
469
unsigned int _gnutls_pkcs11_verify_crt_status(
470
  gnutls_x509_trust_list_t tlist, const char *url,
471
  const gnutls_x509_crt_t *certificate_list, unsigned clist_size,
472
  const char *purpose, unsigned int flags,
473
  gnutls_verify_output_function func);
474
#endif
475
476
int _gnutls_check_cert_sanity(gnutls_x509_crt_t cert);
477
478
int _gnutls_x509_crt_check_revocation(gnutls_x509_crt_t cert,
479
              const gnutls_x509_crl_t *crl_list,
480
              int crl_list_length,
481
              gnutls_verify_output_function func);
482
483
typedef struct gnutls_name_constraints_st {
484
  struct name_constraints_node_st *permitted;
485
  struct name_constraints_node_st *excluded;
486
} gnutls_name_constraints_st;
487
488
typedef struct name_constraints_node_st {
489
  unsigned type;
490
  gnutls_datum_t name;
491
  struct name_constraints_node_st *next;
492
} name_constraints_node_st;
493
494
int _gnutls_extract_name_constraints(asn1_node c2, const char *vstr,
495
             name_constraints_node_st **_nc);
496
void _gnutls_name_constraints_node_free(name_constraints_node_st *node);
497
int _gnutls_x509_name_constraints_merge(gnutls_x509_name_constraints_t nc,
498
          gnutls_x509_name_constraints_t nc2);
499
500
void _gnutls_x509_policies_erase(gnutls_x509_policies_t policies,
501
         unsigned int seq);
502
503
struct gnutls_x509_tlsfeatures_st {
504
  uint16_t feature[MAX_EXT_TYPES];
505
  unsigned int size;
506
};
507
508
unsigned _gnutls_is_broken_sig_allowed(const gnutls_sign_entry_st *se,
509
               unsigned int flags);
510
511
#endif /* GNUTLS_LIB_X509_X509_INT_H */