The FreeRADIUS server  $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
utils.h
Go to the documentation of this file.
1 #pragma once
2 /*
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
16  */
17 #ifdef WITH_TLS
18 /**
19  * $Id: 5d9c3e501c6971e9d7e02c10c4f927de66d86cbc $
20  *
21  * @file lib/tls/utils.h
22  * @brief Miscellaneous TLS utility functions
23  *
24  * @copyright 2021 Arran Cudbard-Bell (a.cudbardb@freeradius.org)
25  */
26 RCSIDH(utils_h, "$Id: 5d9c3e501c6971e9d7e02c10c4f927de66d86cbc $")
27 
28 #include "openssl_user_macros.h"
29 
30 #include <openssl/ssl.h>
31 
32 #include <freeradius-devel/util/time.h>
33 #include <freeradius-devel/server/request.h>
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 char const *fr_tls_utils_x509_pkey_type(X509 *cert);
40 
41 int fr_tls_utils_keyblock_size_get(request_t *request, SSL *ssl);
42 
43 int fr_tls_utils_asn1time_to_epoch(time_t *out, ASN1_TIME const *asn1);
44 
45 #ifdef __cplusplus
46 }
47 #endif
48 #endif /* WITH_TLS */
#define RCSIDH(h, id)
Definition: build.h:445
char const * fr_tls_utils_x509_pkey_type(X509 *cert)
Returns a friendly identifier for the public key type of a certificate.
Definition: utils.c:45
int fr_tls_utils_asn1time_to_epoch(time_t *out, ASN1_TIME const *asn1)
Convert OpenSSL's ASN1_TIME to an epoch time.
Definition: utils.c:115
int fr_tls_utils_keyblock_size_get(request_t *request, SSL *ssl)
Returns the OpenSSL keyblock size.
Definition: utils.c:80
static size_t char ** out
Definition: value.h:984