Debian Codegraph @

crt/s2n/api/unstable/allow_ip_in_cn.h

raw symbols SCIP
1 /*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License").
5 * You may not use this file except in compliance with the License.
6 * A copy of the License is located at
7 *
8 * http://aws.amazon.com/apache2.0
9 *
10 * or in the "license" file accompanying this file. This file is distributed
11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12 * express or implied. See the License for the specific language governing
13 * permissions and limitations under the License.
14 */
15
16 #pragma once
17
18 #include <s2n.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25 * @file allow_ip_in_cn.h
26 *
27 * The following API allows certificates with an IP address in the CN field and no SAN extension
28 * to be accepted during hostname validation. This should only be used as a temporary workaround
29 * while certificates are being re-issued with proper iPAddress SAN entries.
30 */
31
32 /**
33 * Allows IP addresses in the Common Name (CN) field to be used for hostname validation.
34 *
35 * By default, s2n-tls rejects certificates that contain an IP address in the CN field when no
36 * Subject Alternative Name (SAN) extension is present. This is in accordance with RFC 6125
37 * section 6.4.4, which states that the CN fallback only applies to fully qualified DNS domain
38 * names, and section 6.2.1, which requires IP reference identities to match only iPAddress SAN
39 * entries.
40 *
41 * Some legacy PKIs issue certificates with IP addresses in the CN field and no iPAddress SAN
42 * entry. `s2n_config_allow_ip_in_cn()` may be called to temporarily allow these certificates
43 * to pass hostname validation while re-issuing certs with proper iPAddress SAN entries.
44 *
45 * @param config The associated connection config.
46 * @returns S2N_SUCCESS on success, S2N_FAILURE on failure.
47 */
48 S2N_API extern int s2n_config_allow_ip_in_cn(struct s2n_config *config);
49
50 #ifdef __cplusplus
51 }
52 #endif