|
| 1 | +diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c |
| 2 | +index 22ef39f..a31ccc5 100644 |
| 3 | +--- a/isisd/isis_circuit.c |
| 4 | ++++ b/isisd/isis_circuit.c |
| 5 | +@@ -13,6 +13,10 @@ |
| 6 | + #include <netinet/if_ether.h> |
| 7 | + #endif |
| 8 | + |
| 9 | ++#ifdef CRYPTO_OPENSSL |
| 10 | ++#include <openssl/evp.h> |
| 11 | ++#endif |
| 12 | ++ |
| 13 | + #include "log.h" |
| 14 | + #include "memory.h" |
| 15 | + #include "vrf.h" |
| 16 | +@@ -1536,6 +1540,10 @@ ferr_r isis_circuit_passwd_set(struct isis_circuit *circuit, |
| 17 | + return ferr_code_bug( |
| 18 | + "circuit password too long (max 254 chars)"); |
| 19 | + |
| 20 | ++ |
| 21 | ++ //When in FIPS mode, the password never gets set in MD5 |
| 22 | ++ if((passwd_type == ISIS_PASSWD_TYPE_HMAC_MD5) && EVP_default_properties_is_fips_enabled(NULL)) |
| 23 | ++ return ferr_cfg_invalid("FIPS mode is enabled, md5 authentication is disabled"); |
| 24 | + circuit->passwd.len = len; |
| 25 | + strlcpy((char *)circuit->passwd.passwd, passwd, |
| 26 | + sizeof(circuit->passwd.passwd)); |
| 27 | +diff --git a/isisd/isisd.c b/isisd/isisd.c |
| 28 | +index 78fbbe1..b7cf6fb 100644 |
| 29 | +--- a/isisd/isisd.c |
| 30 | ++++ b/isisd/isisd.c |
| 31 | +@@ -9,6 +9,10 @@ |
| 32 | + |
| 33 | + #include <zebra.h> |
| 34 | + |
| 35 | ++ |
| 36 | ++#ifdef CRYPTO_OPENSSL |
| 37 | ++#include <openssl/evp.h> |
| 38 | ++#endif |
| 39 | + #include "frrevent.h" |
| 40 | + #include "vty.h" |
| 41 | + #include "command.h" |
| 42 | +@@ -3087,6 +3091,10 @@ static int isis_area_passwd_set(struct isis_area *area, int level, |
| 43 | + if (len > 254) |
| 44 | + return -1; |
| 45 | + |
| 46 | ++ |
| 47 | ++ //When in FIPS mode, the password never get set in MD5 |
| 48 | ++ if ((passwd_type == ISIS_PASSWD_TYPE_HMAC_MD5) && (EVP_default_properties_is_fips_enabled(NULL))) |
| 49 | ++ return ferr_cfg_invalid("FIPS mode is enabled, md5 authentication is disabled"); |
| 50 | + modified.len = len; |
| 51 | + strlcpy((char *)modified.passwd, passwd, |
| 52 | + sizeof(modified.passwd)); |
1 | 53 | diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c |
2 | | -index 631465f..e084ff3 100644 |
| 54 | +index 26b3949..f27e6b6 100644 |
3 | 55 | --- a/ospfd/ospf_vty.c |
4 | 56 | +++ b/ospfd/ospf_vty.c |
5 | | -@@ -1136,6 +1136,11 @@ DEFUN (ospf_area_vlink, |
| 57 | +@@ -7,6 +7,10 @@ |
| 58 | + #include <zebra.h> |
| 59 | + #include <string.h> |
| 60 | + |
| 61 | ++#ifdef CRYPTO_OPENSSL |
| 62 | ++#include <openssl/evp.h> |
| 63 | ++#endif |
| 64 | ++ |
| 65 | + #include "printfrr.h" |
| 66 | + #include "monotime.h" |
| 67 | + #include "memory.h" |
| 68 | +@@ -1105,6 +1109,11 @@ DEFUN (ospf_area_vlink, |
6 | 69 | vl_config.keychain = argv[idx+1]->arg; |
7 | 70 | } else if (argv_find(argv, argc, "message-digest", &idx)) { |
8 | 71 | /* authentication message-digest */ |
9 | | -+ if(FIPS_mode()) |
| 72 | ++ if(EVP_default_properties_is_fips_enabled(NULL)) |
10 | 73 | + { |
11 | 74 | + vty_out(vty, "FIPS mode is enabled, md5 authentication is disabled\n"); |
12 | 75 | + return CMD_WARNING_CONFIG_FAILED; |
13 | 76 | + } |
14 | 77 | vl_config.auth_type = OSPF_AUTH_CRYPTOGRAPHIC; |
15 | 78 | } else if (argv_find(argv, argc, "null", &idx)) { |
16 | 79 | /* "authentication null" */ |
17 | | -@@ -1993,6 +1998,15 @@ DEFUN (ospf_area_authentication_message_digest, |
| 80 | +@@ -2024,6 +2033,15 @@ DEFUN (ospf_area_authentication_message_digest, |
18 | 81 | ? OSPF_AUTH_NULL |
19 | 82 | : OSPF_AUTH_CRYPTOGRAPHIC; |
20 | 83 |
|
| 84 | ++ |
21 | 85 | + if(area->auth_type == OSPF_AUTH_CRYPTOGRAPHIC) |
22 | 86 | + { |
23 | | -+ if(FIPS_mode()) |
| 87 | ++ if(EVP_default_properties_is_fips_enabled(NULL)) |
24 | 88 | + { |
25 | 89 | + vty_out(vty, "FIPS mode is enabled, md5 authentication is disabled\n"); |
26 | 90 | + return CMD_WARNING_CONFIG_FAILED; |
27 | 91 | + } |
28 | 92 | + } |
29 | | -+ |
30 | 93 | return CMD_SUCCESS; |
31 | 94 | } |
32 | 95 |
|
33 | | -@@ -6665,6 +6679,11 @@ DEFUN (ip_ospf_authentication_args, |
| 96 | +@@ -7446,6 +7464,11 @@ DEFUN (ip_ospf_authentication_args, |
34 | 97 |
|
35 | 98 | /* Handle message-digest authentication */ |
36 | 99 | if (argv[idx_encryption]->arg[0] == 'm') { |
37 | | -+ if(FIPS_mode()) |
| 100 | ++ if(EVP_default_properties_is_fips_enabled(NULL)) |
38 | 101 | + { |
39 | 102 | + vty_out(vty, "FIPS mode is enabled, md5 authentication is disabled\n"); |
40 | 103 | + return CMD_WARNING_CONFIG_FAILED; |
41 | 104 | + } |
42 | 105 | SET_IF_PARAM(params, auth_type); |
43 | 106 | params->auth_type = OSPF_AUTH_CRYPTOGRAPHIC; |
44 | 107 | UNSET_IF_PARAM(params, keychain_name); |
45 | | -@@ -6971,6 +6990,11 @@ DEFUN (ip_ospf_message_digest_key, |
| 108 | +@@ -7776,6 +7799,11 @@ DEFUN (ip_ospf_message_digest_key, |
46 | 109 | "The OSPF password (key)\n" |
47 | 110 | "Address of interface\n") |
48 | 111 | { |
49 | | -+ if(FIPS_mode()) |
| 112 | ++ if(EVP_default_properties_is_fips_enabled(NULL)) |
50 | 113 | + { |
51 | 114 | + vty_out(vty, "FIPS mode is enabled, md5 authentication is disabled\n"); |
52 | 115 | + return CMD_WARNING_CONFIG_FAILED; |
53 | 116 | + } |
54 | 117 | VTY_DECLVAR_CONTEXT(interface, ifp); |
55 | 118 | struct crypt_key *ck; |
56 | 119 | uint8_t key_id; |
57 | | -diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c |
58 | | -index 81b4b39..cce33d9 100644 |
59 | | ---- a/isisd/isis_circuit.c |
60 | | -+++ b/isisd/isis_circuit.c |
61 | | -@@ -1318,6 +1318,10 @@ static int isis_circuit_passwd_set(struct isis_circuit *circuit, |
62 | | - return ferr_code_bug( |
63 | | - "circuit password too long (max 254 chars)"); |
64 | | - |
65 | | -+ //When in FIPS mode, the password never gets set in MD5 |
66 | | -+ if((passwd_type == ISIS_PASSWD_TYPE_HMAC_MD5) && FIPS_mode()) |
67 | | -+ return ferr_cfg_invalid("FIPS mode is enabled, md5 authentication is disabled"); |
68 | | -+ |
69 | | - circuit->passwd.len = len; |
70 | | - strlcpy((char *)circuit->passwd.passwd, passwd, |
71 | | - sizeof(circuit->passwd.passwd)); |
72 | | -diff --git a/isisd/isisd.c b/isisd/isisd.c |
73 | | -index 419127c..a6c36af 100644 |
74 | | ---- a/isisd/isisd.c |
75 | | -+++ b/isisd/isisd.c |
76 | | -@@ -1638,6 +1638,10 @@ static int isis_area_passwd_set(struct isis_area *area, int level, |
77 | | - if (len > 254) |
78 | | - return -1; |
79 | | - |
80 | | -+ //When in FIPS mode, the password never get set in MD5 |
81 | | -+ if ((passwd_type == ISIS_PASSWD_TYPE_HMAC_MD5) && (FIPS_mode())) |
82 | | -+ return ferr_cfg_invalid("FIPS mode is enabled, md5 authentication is disabled"); |
83 | | -+ |
84 | | - modified.len = len; |
85 | | - strlcpy((char *)modified.passwd, passwd, |
86 | | - sizeof(modified.passwd)); |
87 | 120 | diff --git a/ripd/rip_cli.c b/ripd/rip_cli.c |
88 | | -index 5bb81ef..02a09ef 100644 |
| 121 | +index 7540f98..a010b64 100644 |
89 | 122 | --- a/ripd/rip_cli.c |
90 | 123 | +++ b/ripd/rip_cli.c |
91 | | -@@ -796,6 +796,12 @@ DEFPY (ip_rip_authentication_mode, |
| 124 | +@@ -7,6 +7,10 @@ |
| 125 | + |
| 126 | + #include <zebra.h> |
| 127 | + |
| 128 | ++ |
| 129 | ++#ifdef CRYPTO_OPENSSL |
| 130 | ++#include <openssl/evp.h> |
| 131 | ++#endif |
| 132 | + #include "if.h" |
| 133 | + #include "if_rmap.h" |
| 134 | + #include "vrf.h" |
| 135 | +@@ -903,6 +907,12 @@ DEFPY_YANG (ip_rip_authentication_mode, |
92 | 136 | value = "20"; |
93 | 137 | } |
94 | 138 |
|
95 | | -+ if(strmatch(mode, "md5") && FIPS_mode()) |
| 139 | ++ |
| 140 | ++ if(strmatch(mode, "md5") && EVP_default_properties_is_fips_enabled(NULL)) |
96 | 141 | + { |
97 | 142 | + vty_out(vty, "FIPS mode is enabled, md5 authentication id disabled\n"); |
98 | 143 | + return CMD_WARNING_CONFIG_FAILED; |
99 | 144 | + } |
100 | | -+ |
101 | 145 | nb_cli_enqueue_change(vty, "./authentication-scheme/mode", NB_OP_MODIFY, |
102 | 146 | strmatch(mode, "md5") ? "md5" : "plain-text"); |
103 | 147 | if (strmatch(mode, "md5")) |
104 | | -diff --git a/lib/zebra.h b/lib/zebra.h |
105 | | -index 53ae5b4..930307f 100644 |
106 | | ---- a/lib/zebra.h |
107 | | -+++ b/lib/zebra.h |
108 | | -@@ -114,6 +114,7 @@ |
109 | | - #ifdef CRYPTO_OPENSSL |
110 | | - #include <openssl/evp.h> |
111 | | - #include <openssl/hmac.h> |
112 | | -+#include <openssl/fips.h> |
113 | | - #endif |
114 | | - |
115 | | - #include "openbsd-tree.h" |
|
0 commit comments