xref: /freebsd/contrib/wpa/src/tls/tlsv1_cred.h (revision 39beb93c3f8bdbf72a61fda42300b5ebed7390c8)
1 /*
2  * TLSv1 credentials
3  * Copyright (c) 2006-2007, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14 
15 #ifndef TLSV1_CRED_H
16 #define TLSV1_CRED_H
17 
18 struct tlsv1_credentials {
19 	struct x509_certificate *trusted_certs;
20 	struct x509_certificate *cert;
21 	struct crypto_private_key *key;
22 
23 	/* Diffie-Hellman parameters */
24 	u8 *dh_p; /* prime */
25 	size_t dh_p_len;
26 	u8 *dh_g; /* generator */
27 	size_t dh_g_len;
28 };
29 
30 
31 struct tlsv1_credentials * tlsv1_cred_alloc(void);
32 void tlsv1_cred_free(struct tlsv1_credentials *cred);
33 int tlsv1_set_ca_cert(struct tlsv1_credentials *cred, const char *cert,
34 		      const u8 *cert_blob, size_t cert_blob_len,
35 		      const char *path);
36 int tlsv1_set_cert(struct tlsv1_credentials *cred, const char *cert,
37 		   const u8 *cert_blob, size_t cert_blob_len);
38 int tlsv1_set_private_key(struct tlsv1_credentials *cred,
39 			  const char *private_key,
40 			  const char *private_key_passwd,
41 			  const u8 *private_key_blob,
42 			  size_t private_key_blob_len);
43 int tlsv1_set_dhparams(struct tlsv1_credentials *cred, const char *dh_file,
44 		       const u8 *dh_blob, size_t dh_blob_len);
45 
46 #endif /* TLSV1_CRED_H */
47