Blame SOURCES/0003-disable-eigrp-crypto.patch

800a7b
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
800a7b
index bedaf15..8dc09bf 100644
800a7b
--- a/eigrpd/eigrp_packet.c
800a7b
+++ b/eigrpd/eigrp_packet.c
800a7b
@@ -40,8 +40,10 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
 #include "sha256.h"
800a7b
+#endif
800a7b
 #include "lib_errors.h"
800a7b
 
800a7b
 #include "eigrpd/eigrp_structs.h"
800a7b
@@ -95,8 +97,12 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 	struct key *key = NULL;
800a7b
 	struct keychain *keychain;
800a7b
 
800a7b
+
800a7b
 	unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	MD5_CTX ctx;
800a7b
+#endif
800a7b
 	uint8_t *ibuf;
800a7b
 	size_t backup_get, backup_end;
800a7b
 	struct TLV_MD5_Authentication_Type *auth_TLV;
800a7b
@@ -119,6 +125,9 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 		return EIGRP_AUTH_TYPE_NONE;
800a7b
 	}
800a7b
 
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+//TBD when this is fixed in upstream
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	memset(&ctx, 0, sizeof(ctx));
800a7b
 	MD5Init(&ctx;;
800a7b
 
800a7b
@@ -146,7 +155,7 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 	}
800a7b
 
800a7b
 	MD5Final(digest, &ctx;;
800a7b
-
800a7b
+#endif
800a7b
 	/* Append md5 digest to the end of the stream. */
800a7b
 	memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_MD5_LEN);
800a7b
 
800a7b
@@ -162,7 +171,10 @@ int eigrp_check_md5_digest(struct stream *s,
800a7b
 			   struct TLV_MD5_Authentication_Type *authTLV,
800a7b
 			   struct eigrp_neighbor *nbr, uint8_t flags)
800a7b
 {
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	MD5_CTX ctx;
800a7b
+#endif
800a7b
 	unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
800a7b
 	unsigned char orig[EIGRP_AUTH_TYPE_MD5_LEN];
800a7b
 	struct key *key = NULL;
800a7b
@@ -203,6 +215,9 @@ int eigrp_check_md5_digest(struct stream *s,
800a7b
 		return 0;
800a7b
 	}
800a7b
 
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+	//TBD when eigrpd crypto is fixed in upstream
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	memset(&ctx, 0, sizeof(ctx));
800a7b
 	MD5Init(&ctx;;
800a7b
 
800a7b
@@ -230,6 +245,7 @@ int eigrp_check_md5_digest(struct stream *s,
800a7b
 	}
800a7b
 
800a7b
 	MD5Final(digest, &ctx;;
800a7b
+#endif
800a7b
 
800a7b
 	/* compare the two */
800a7b
 	if (memcmp(orig, digest, EIGRP_AUTH_TYPE_MD5_LEN) != 0) {
800a7b
@@ -254,7 +270,11 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 	unsigned char digest[EIGRP_AUTH_TYPE_SHA256_LEN];
800a7b
 	unsigned char buffer[1 + PLAINTEXT_LENGTH + 45 + 1] = {0};
800a7b
 
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+	//TBD when eigrpd crypto is fixed in upstream
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	HMAC_SHA256_CTX ctx;
800a7b
+#endif
800a7b
 	void *ibuf;
800a7b
 	size_t backup_get, backup_end;
800a7b
 	struct TLV_SHA256_Authentication_Type *auth_TLV;
800a7b
@@ -283,6 +303,9 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 
80b0bb
 	inet_ntop(AF_INET, &ei->address.u.prefix4, source_ip, PREFIX_STRLEN);
800a7b
 
800a7b
+#ifdef CRYPTO_OPENSSL
800a7b
+	//TBD when eigrpd crypto is fixed in upstream
800a7b
+#elif CRYPTO_INTERNAL
800a7b
 	memset(&ctx, 0, sizeof(ctx));
800a7b
 	buffer[0] = '\n';
800a7b
 	memcpy(buffer + 1, key, strlen(key->string));
800a7b
@@ -291,7 +314,7 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
800a7b
 			  1 + strlen(key->string) + strlen(source_ip));
800a7b
 	HMAC__SHA256_Update(&ctx, ibuf, strlen(ibuf));
800a7b
 	HMAC__SHA256_Final(digest, &ctx;;
800a7b
-
800a7b
+#endif
800a7b
 
800a7b
 	/* Put hmac-sha256 digest to it's place */
800a7b
 	memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_SHA256_LEN);
800a7b
diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c
800a7b
index 93eed94..f1c7347 100644
800a7b
--- a/eigrpd/eigrp_filter.c
800a7b
+++ b/eigrpd/eigrp_filter.c
800a7b
@@ -47,7 +47,9 @@
800a7b
 #include "if_rmap.h"
800a7b
 #include "plist.h"
800a7b
 #include "distribute.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "keychain.h"
800a7b
 #include "privs.h"
800a7b
 #include "vrf.h"
800a7b
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c
800a7b
index dacd5ca..b232cc5 100644
800a7b
--- a/eigrpd/eigrp_hello.c
800a7b
+++ b/eigrpd/eigrp_hello.c
800a7b
@@ -43,7 +43,9 @@
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
 #include "vty.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 
800a7b
 #include "eigrpd/eigrp_structs.h"
800a7b
 #include "eigrpd/eigrpd.h"
800a7b
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
800a7b
index 84dcf5e..a2575e3 100644
800a7b
--- a/eigrpd/eigrp_query.c
800a7b
+++ b/eigrpd/eigrp_query.c
800a7b
@@ -38,7 +38,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "vty.h"
800a7b
 
800a7b
 #include "eigrpd/eigrp_structs.h"
800a7b
diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c
800a7b
index ccf0496..2902365 100644
800a7b
--- a/eigrpd/eigrp_reply.c
800a7b
+++ b/eigrpd/eigrp_reply.c
800a7b
@@ -42,7 +42,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "vty.h"
800a7b
 #include "keychain.h"
800a7b
 #include "plist.h"
800a7b
diff --git a/eigrpd/eigrp_siaquery.c b/eigrpd/eigrp_siaquery.c
800a7b
index ff38325..09b9369 100644
800a7b
--- a/eigrpd/eigrp_siaquery.c
800a7b
+++ b/eigrpd/eigrp_siaquery.c
800a7b
@@ -38,7 +38,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "vty.h"
800a7b
 
800a7b
 #include "eigrpd/eigrp_structs.h"
800a7b
diff --git a/eigrpd/eigrp_siareply.c b/eigrpd/eigrp_siareply.c
800a7b
index d3dd123..f6a2bd6 100644
800a7b
--- a/eigrpd/eigrp_siareply.c
800a7b
+++ b/eigrpd/eigrp_siareply.c
800a7b
@@ -37,7 +37,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "vty.h"
800a7b
 
800a7b
 #include "eigrpd/eigrp_structs.h"
800a7b
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
800a7b
index 21c9238..cfb8890 100644
800a7b
--- a/eigrpd/eigrp_snmp.c
800a7b
+++ b/eigrpd/eigrp_snmp.c
800a7b
@@ -42,7 +42,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "keychain.h"
800a7b
 #include "smux.h"
800a7b
 
800a7b
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
800a7b
index 8db4903..2a4f0bb 100644
800a7b
--- a/eigrpd/eigrp_update.c
800a7b
+++ b/eigrpd/eigrp_update.c
800a7b
@@ -42,7 +42,9 @@
800a7b
 #include "log.h"
800a7b
 #include "sockopt.h"
800a7b
 #include "checksum.h"
800a7b
+#ifdef CRYPTO_INTERNAL
800a7b
 #include "md5.h"
800a7b
+#endif
800a7b
 #include "vty.h"
800a7b
 #include "plist.h"
800a7b
 #include "plist_int.h"
80b0bb
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c
80b0bb
index a93d4c8..b01e121 100644
80b0bb
--- a/eigrpd/eigrp_cli.c
80b0bb
+++ b/eigrpd/eigrp_cli.c
80b0bb
@@ -25,6 +25,7 @@
80b0bb
 #include "lib/command.h"
80b0bb
 #include "lib/log.h"
80b0bb
 #include "lib/northbound_cli.h"
80b0bb
+#include "lib/libfrr.h"
80b0bb
 
80b0bb
 #include "eigrp_structs.h"
80b0bb
 #include "eigrpd.h"
80b0bb
@@ -726,6 +726,20 @@ DEFPY(
80b0bb
 	"Keyed message digest\n"
80b0bb
 	"HMAC SHA256 algorithm \n")
80b0bb
 {
80b0bb
+	//EIGRP authentication is currently broken in FRR
80b0bb
+	switch (frr_get_cli_mode()) {
80b0bb
+	case FRR_CLI_CLASSIC:
80b0bb
+		vty_out(vty, "%% Eigrp Authentication is disabled\n\n");
80b0bb
+		break;
80b0bb
+	case FRR_CLI_TRANSACTIONAL:
80b0bb
+		vty_out(vty,
80b0bb
+			"%% Failed to edit candidate configuration - "
80b0bb
+			"Eigrp Authentication is disabled.\n\n");
80b0bb
+		break;
80b0bb
+	}
80b0bb
+
80b0bb
+	return CMD_WARNING_CONFIG_FAILED;
80b0bb
+
80b0bb
 	char xpath[XPATH_MAXLEN], xpath_auth[XPATH_MAXLEN + 64];
80b0bb
 
80b0bb
 	snprintf(xpath, sizeof(xpath), "./frr-eigrpd:eigrp/instance[asn='%s']",