blob: 716e93c39006ca818d6737495c39b4b53cdeaaa9 [file] [log] [blame]
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07001/*
2 * TLSv1 credentials
3 * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
4 *
Dmitry Shmidtc5ec7f52012-03-06 16:33:24 -08005 * This software may be distributed under the terms of the BSD license.
6 * See README for more details.
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -07007 */
8
9#ifndef TLSV1_CRED_H
10#define TLSV1_CRED_H
11
12struct tlsv1_credentials {
13 struct x509_certificate *trusted_certs;
14 struct x509_certificate *cert;
15 struct crypto_private_key *key;
16
Dmitry Shmidtd7ff03d2015-12-04 14:49:35 -080017 unsigned int cert_probe:1;
18 unsigned int ca_cert_verify:1;
19 unsigned int server_cert_only:1;
20 u8 srv_cert_hash[32];
21
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070022 /* Diffie-Hellman parameters */
23 u8 *dh_p; /* prime */
24 size_t dh_p_len;
25 u8 *dh_g; /* generator */
26 size_t dh_g_len;
Dmitry Shmidtd97138d2015-12-28 13:27:49 -080027
28 char *ocsp_stapling_response;
29 char *ocsp_stapling_response_multi;
Dmitry Shmidt8d520ff2011-05-09 14:06:53 -070030};
31
32
33struct tlsv1_credentials * tlsv1_cred_alloc(void);
34void tlsv1_cred_free(struct tlsv1_credentials *cred);
35int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert,
36 const u8 *cert_blob, size_t cert_blob_len,
37 const char *path);
38int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert,
39 const u8 *cert_blob, size_t cert_blob_len);
40int tlsv1_set_private_key(struct tlsv1_credentials *cred,
41 const char *private_key,
42 const char *private_key_passwd,
43 const u8 *private_key_blob,
44 size_t private_key_blob_len);
45int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file,
46 const u8 *dh_blob, size_t dh_blob_len);
47
48#endif /* TLSV1_CRED_H */