rabbitmq-c  0.8.0
C AMQP Client library for RabbitMQ
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
amqp_openssl_hostname_validation.h
1 /* vim:set ft=c ts=2 sw=2 sts=2 et cindent: */
2 #ifndef librabbitmq_amqp_openssl_hostname_validation_h
3 #define librabbitmq_amqp_openssl_hostname_validation_h
4 
5 /*
6  * Copyright (C) 2012, iSEC Partners.
7  * Copyright (C) 2015 Alan Antonuk.
8  *
9  * All rights reserved.
10  *
11  * Permission to use, copy, modify, and distribute this software for any
12  * purpose with or without fee is hereby granted, provided that the above
13  * copyright notice and this permission notice appear in all copies.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
19  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21  * USE OR OTHER DEALINGS IN THE SOFTWARE.
22  *
23  * Except as contained in this notice, the name of a copyright holder shall
24  * not be used in advertising or otherwise to promote the sale, use or other
25  * dealings in this Software without prior written authorization of the
26  * copyright holder.
27  */
28 
29 /* Originally from:
30  * https://github.com/iSECPartners/ssl-conservatory
31  * https://wiki.openssl.org/index.php/Hostname_validation
32  */
33 
34 #include <openssl/x509v3.h>
35 
36 typedef enum {
37  AMQP_HVR_MATCH_FOUND,
38  AMQP_HVR_MATCH_NOT_FOUND,
39  AMQP_HVR_NO_SAN_PRESENT,
40  AMQP_HVR_MALFORMED_CERTIFICATE,
41  AMQP_HVR_ERROR
42 } amqp_hostname_validation_result;
43 
56 amqp_hostname_validation_result amqp_ssl_validate_hostname(
57  const char *hostname, const X509 *server_cert);
58 
59 #endif