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

c0b7e4
diff --git a/eigrpd/eigrp_vty.c b/eigrpd/eigrp_vty.c
c0b7e4
index fc5bdbd..56ebac6 100644
c0b7e4
--- a/eigrpd/eigrp_vty.c
c0b7e4
+++ b/eigrpd/eigrp_vty.c
c0b7e4
@@ -968,6 +968,9 @@ DEFUN (eigrp_authentication_mode,
c0b7e4
        "Keyed message digest\n"
c0b7e4
        "HMAC SHA256 algorithm \n")
c0b7e4
 {
c0b7e4
+	vty_out(vty, " EIGRP Authentication is disabled\n");
c0b7e4
+	return CMD_WARNING_CONFIG_FAILED;
c0b7e4
+
c0b7e4
 	VTY_DECLVAR_CONTEXT(interface, ifp);
c0b7e4
 	struct eigrp_interface *ei = ifp->info;
c0b7e4
 	struct eigrp *eigrp;
c0b7e4
@@ -1003,6 +1006,9 @@ DEFUN (no_eigrp_authentication_mode,
c0b7e4
        "Keyed message digest\n"
c0b7e4
        "HMAC SHA256 algorithm \n")
c0b7e4
 {
c0b7e4
+	vty_out(vty, " EIGRP Authentication is disabled\n");
c0b7e4
+	return CMD_WARNING_CONFIG_FAILED;
c0b7e4
+
c0b7e4
 	VTY_DECLVAR_CONTEXT(interface, ifp);
c0b7e4
 	struct eigrp_interface *ei = ifp->info;
c0b7e4
 	struct eigrp *eigrp;
c0b7e4
@@ -1034,6 +1040,9 @@ DEFPY (eigrp_authentication_keychain,
c0b7e4
        "Autonomous system number\n"
c0b7e4
        "Name of key-chain\n")
c0b7e4
 {
c0b7e4
+	vty_out(vty, " EIGRP Authentication is disabled\n");
c0b7e4
+	return CMD_WARNING_CONFIG_FAILED;
c0b7e4
+
c0b7e4
 	VTY_DECLVAR_CONTEXT(interface, ifp);
c0b7e4
 	struct eigrp_interface *ei = ifp->info;
c0b7e4
 	struct eigrp *eigrp;
c0b7e4
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
c0b7e4
index bedaf15..8dc09bf 100644
c0b7e4
--- a/eigrpd/eigrp_packet.c
c0b7e4
+++ b/eigrpd/eigrp_packet.c
c0b7e4
@@ -40,8 +40,10 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
 #include "sha256.h"
c0b7e4
+#endif
c0b7e4
 #include "lib_errors.h"
c0b7e4
 
c0b7e4
 #include "eigrpd/eigrp_structs.h"
c0b7e4
@@ -95,8 +97,12 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 	struct key *key = NULL;
c0b7e4
 	struct keychain *keychain;
c0b7e4
 
c0b7e4
+
c0b7e4
 	unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	MD5_CTX ctx;
c0b7e4
+#endif
c0b7e4
 	uint8_t *ibuf;
c0b7e4
 	size_t backup_get, backup_end;
c0b7e4
 	struct TLV_MD5_Authentication_Type *auth_TLV;
c0b7e4
@@ -119,6 +125,9 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 		return EIGRP_AUTH_TYPE_NONE;
c0b7e4
 	}
c0b7e4
 
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+//TBD when this is fixed in upstream
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	memset(&ctx, 0, sizeof(ctx));
c0b7e4
 	MD5Init(&ctx;;
c0b7e4
 
c0b7e4
@@ -146,7 +155,7 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 	}
c0b7e4
 
c0b7e4
 	MD5Final(digest, &ctx;;
c0b7e4
-
c0b7e4
+#endif
c0b7e4
 	/* Append md5 digest to the end of the stream. */
c0b7e4
 	memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_MD5_LEN);
c0b7e4
 
c0b7e4
@@ -162,7 +171,10 @@ int eigrp_check_md5_digest(struct stream *s,
c0b7e4
 			   struct TLV_MD5_Authentication_Type *authTLV,
c0b7e4
 			   struct eigrp_neighbor *nbr, uint8_t flags)
c0b7e4
 {
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	MD5_CTX ctx;
c0b7e4
+#endif
c0b7e4
 	unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
c0b7e4
 	unsigned char orig[EIGRP_AUTH_TYPE_MD5_LEN];
c0b7e4
 	struct key *key = NULL;
c0b7e4
@@ -203,6 +215,9 @@ int eigrp_check_md5_digest(struct stream *s,
c0b7e4
 		return 0;
c0b7e4
 	}
c0b7e4
 
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+	//TBD when eigrpd crypto is fixed in upstream
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	memset(&ctx, 0, sizeof(ctx));
c0b7e4
 	MD5Init(&ctx;;
c0b7e4
 
c0b7e4
@@ -230,6 +245,7 @@ int eigrp_check_md5_digest(struct stream *s,
c0b7e4
 	}
c0b7e4
 
c0b7e4
 	MD5Final(digest, &ctx;;
c0b7e4
+#endif
c0b7e4
 
c0b7e4
 	/* compare the two */
c0b7e4
 	if (memcmp(orig, digest, EIGRP_AUTH_TYPE_MD5_LEN) != 0) {
c0b7e4
@@ -254,7 +270,11 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 	unsigned char digest[EIGRP_AUTH_TYPE_SHA256_LEN];
c0b7e4
 	unsigned char buffer[1 + PLAINTEXT_LENGTH + 45 + 1] = {0};
c0b7e4
 
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+	//TBD when eigrpd crypto is fixed in upstream
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	HMAC_SHA256_CTX ctx;
c0b7e4
+#endif
c0b7e4
 	void *ibuf;
c0b7e4
 	size_t backup_get, backup_end;
c0b7e4
 	struct TLV_SHA256_Authentication_Type *auth_TLV;
c0b7e4
@@ -283,6 +303,9 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 
c0b7e4
 	inet_ntop(AF_INET, &ei->address->u.prefix4, source_ip, PREFIX_STRLEN);
c0b7e4
 
c0b7e4
+#ifdef CRYPTO_OPENSSL
c0b7e4
+	//TBD when eigrpd crypto is fixed in upstream
c0b7e4
+#elif CRYPTO_INTERNAL
c0b7e4
 	memset(&ctx, 0, sizeof(ctx));
c0b7e4
 	buffer[0] = '\n';
c0b7e4
 	memcpy(buffer + 1, key, strlen(key->string));
c0b7e4
@@ -291,7 +314,7 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
c0b7e4
 			  1 + strlen(key->string) + strlen(source_ip));
c0b7e4
 	HMAC__SHA256_Update(&ctx, ibuf, strlen(ibuf));
c0b7e4
 	HMAC__SHA256_Final(digest, &ctx;;
c0b7e4
-
c0b7e4
+#endif
c0b7e4
 
c0b7e4
 	/* Put hmac-sha256 digest to it's place */
c0b7e4
 	memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_SHA256_LEN);
c0b7e4
diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c
c0b7e4
index 93eed94..f1c7347 100644
c0b7e4
--- a/eigrpd/eigrp_filter.c
c0b7e4
+++ b/eigrpd/eigrp_filter.c
c0b7e4
@@ -47,7 +47,9 @@
c0b7e4
 #include "if_rmap.h"
c0b7e4
 #include "plist.h"
c0b7e4
 #include "distribute.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "keychain.h"
c0b7e4
 #include "privs.h"
c0b7e4
 #include "vrf.h"
c0b7e4
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c
c0b7e4
index dacd5ca..b232cc5 100644
c0b7e4
--- a/eigrpd/eigrp_hello.c
c0b7e4
+++ b/eigrpd/eigrp_hello.c
c0b7e4
@@ -43,7 +43,9 @@
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
 #include "vty.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 
c0b7e4
 #include "eigrpd/eigrp_structs.h"
c0b7e4
 #include "eigrpd/eigrpd.h"
c0b7e4
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
c0b7e4
index 84dcf5e..a2575e3 100644
c0b7e4
--- a/eigrpd/eigrp_query.c
c0b7e4
+++ b/eigrpd/eigrp_query.c
c0b7e4
@@ -38,7 +38,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "vty.h"
c0b7e4
 
c0b7e4
 #include "eigrpd/eigrp_structs.h"
c0b7e4
diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c
c0b7e4
index ccf0496..2902365 100644
c0b7e4
--- a/eigrpd/eigrp_reply.c
c0b7e4
+++ b/eigrpd/eigrp_reply.c
c0b7e4
@@ -42,7 +42,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "vty.h"
c0b7e4
 #include "keychain.h"
c0b7e4
 #include "plist.h"
c0b7e4
diff --git a/eigrpd/eigrp_siaquery.c b/eigrpd/eigrp_siaquery.c
c0b7e4
index ff38325..09b9369 100644
c0b7e4
--- a/eigrpd/eigrp_siaquery.c
c0b7e4
+++ b/eigrpd/eigrp_siaquery.c
c0b7e4
@@ -38,7 +38,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "vty.h"
c0b7e4
 
c0b7e4
 #include "eigrpd/eigrp_structs.h"
c0b7e4
diff --git a/eigrpd/eigrp_siareply.c b/eigrpd/eigrp_siareply.c
c0b7e4
index d3dd123..f6a2bd6 100644
c0b7e4
--- a/eigrpd/eigrp_siareply.c
c0b7e4
+++ b/eigrpd/eigrp_siareply.c
c0b7e4
@@ -37,7 +37,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "vty.h"
c0b7e4
 
c0b7e4
 #include "eigrpd/eigrp_structs.h"
c0b7e4
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
c0b7e4
index 21c9238..cfb8890 100644
c0b7e4
--- a/eigrpd/eigrp_snmp.c
c0b7e4
+++ b/eigrpd/eigrp_snmp.c
c0b7e4
@@ -42,7 +42,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "keychain.h"
c0b7e4
 #include "smux.h"
c0b7e4
 
c0b7e4
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
c0b7e4
index 8db4903..2a4f0bb 100644
c0b7e4
--- a/eigrpd/eigrp_update.c
c0b7e4
+++ b/eigrpd/eigrp_update.c
c0b7e4
@@ -42,7 +42,9 @@
c0b7e4
 #include "log.h"
c0b7e4
 #include "sockopt.h"
c0b7e4
 #include "checksum.h"
c0b7e4
+#ifdef CRYPTO_INTERNAL
c0b7e4
 #include "md5.h"
c0b7e4
+#endif
c0b7e4
 #include "vty.h"
c0b7e4
 #include "plist.h"
c0b7e4
 #include "plist_int.h"