253 lines
6.6 KiB
Diff
253 lines
6.6 KiB
Diff
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c
|
|
index 533d7de2c..bef214cb0 100644
|
|
--- a/eigrpd/eigrp_cli.c
|
|
+++ b/eigrpd/eigrp_cli.c
|
|
@@ -25,6 +25,7 @@
|
|
#include "lib/command.h"
|
|
#include "lib/log.h"
|
|
#include "lib/northbound_cli.h"
|
|
+#include "lib/libfrr.h"
|
|
|
|
#include "eigrp_structs.h"
|
|
#include "eigrpd.h"
|
|
@@ -728,6 +729,20 @@ DEFPY_YANG(
|
|
"Keyed message digest\n"
|
|
"HMAC SHA256 algorithm \n")
|
|
{
|
|
+ //EIGRP authentication is currently broken in FRR
|
|
+ switch (frr_get_cli_mode()) {
|
|
+ case FRR_CLI_CLASSIC:
|
|
+ vty_out(vty, "%% Eigrp Authentication is disabled\n\n");
|
|
+ break;
|
|
+ case FRR_CLI_TRANSACTIONAL:
|
|
+ vty_out(vty,
|
|
+ "%% Failed to edit candidate configuration - "
|
|
+ "Eigrp Authentication is disabled.\n\n");
|
|
+ break;
|
|
+ }
|
|
+
|
|
+ return CMD_WARNING_CONFIG_FAILED;
|
|
+
|
|
char xpath[XPATH_MAXLEN], xpath_auth[XPATH_MAXLEN + 64];
|
|
|
|
snprintf(xpath, sizeof(xpath), "./frr-eigrpd:eigrp/instance[asn='%s']",
|
|
diff --git a/eigrpd/eigrp_filter.c b/eigrpd/eigrp_filter.c
|
|
index 8f80b78d2..6aeeff78e 100644
|
|
--- a/eigrpd/eigrp_filter.c
|
|
+++ b/eigrpd/eigrp_filter.c
|
|
@@ -47,7 +47,9 @@
|
|
#include "if_rmap.h"
|
|
#include "plist.h"
|
|
#include "distribute.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "keychain.h"
|
|
#include "privs.h"
|
|
#include "vrf.h"
|
|
diff --git a/eigrpd/eigrp_hello.c b/eigrpd/eigrp_hello.c
|
|
index e3680b31a..56ea9d0e9 100644
|
|
--- a/eigrpd/eigrp_hello.c
|
|
+++ b/eigrpd/eigrp_hello.c
|
|
@@ -43,7 +43,9 @@
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
#include "vty.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
|
|
#include "eigrpd/eigrp_structs.h"
|
|
#include "eigrpd/eigrpd.h"
|
|
diff --git a/eigrpd/eigrp_packet.c b/eigrpd/eigrp_packet.c
|
|
index 39e384c12..972e6320a 100644
|
|
--- a/eigrpd/eigrp_packet.c
|
|
+++ b/eigrpd/eigrp_packet.c
|
|
@@ -40,8 +40,10 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
#include "sha256.h"
|
|
+#endif
|
|
#include "lib_errors.h"
|
|
|
|
#include "eigrpd/eigrp_structs.h"
|
|
@@ -103,8 +105,12 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
|
|
struct key *key = NULL;
|
|
struct keychain *keychain;
|
|
|
|
+
|
|
unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+#elif CRYPTO_INTERNAL
|
|
MD5_CTX ctx;
|
|
+#endif
|
|
uint8_t *ibuf;
|
|
size_t backup_get, backup_end;
|
|
struct TLV_MD5_Authentication_Type *auth_TLV;
|
|
@@ -127,6 +133,9 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
|
|
return EIGRP_AUTH_TYPE_NONE;
|
|
}
|
|
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+//TBD when this is fixed in upstream
|
|
+#elif CRYPTO_INTERNAL
|
|
memset(&ctx, 0, sizeof(ctx));
|
|
MD5Init(&ctx);
|
|
|
|
@@ -154,7 +163,7 @@ int eigrp_make_md5_digest(struct eigrp_interface *ei, struct stream *s,
|
|
}
|
|
|
|
MD5Final(digest, &ctx);
|
|
-
|
|
+#endif
|
|
/* Append md5 digest to the end of the stream. */
|
|
memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_MD5_LEN);
|
|
|
|
@@ -170,7 +179,10 @@ int eigrp_check_md5_digest(struct stream *s,
|
|
struct TLV_MD5_Authentication_Type *authTLV,
|
|
struct eigrp_neighbor *nbr, uint8_t flags)
|
|
{
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+#elif CRYPTO_INTERNAL
|
|
MD5_CTX ctx;
|
|
+#endif
|
|
unsigned char digest[EIGRP_AUTH_TYPE_MD5_LEN];
|
|
unsigned char orig[EIGRP_AUTH_TYPE_MD5_LEN];
|
|
struct key *key = NULL;
|
|
@@ -211,6 +223,9 @@ int eigrp_check_md5_digest(struct stream *s,
|
|
return 0;
|
|
}
|
|
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+ //TBD when eigrpd crypto is fixed in upstream
|
|
+#elif CRYPTO_INTERNAL
|
|
memset(&ctx, 0, sizeof(ctx));
|
|
MD5Init(&ctx);
|
|
|
|
@@ -238,6 +253,7 @@ int eigrp_check_md5_digest(struct stream *s,
|
|
}
|
|
|
|
MD5Final(digest, &ctx);
|
|
+#endif
|
|
|
|
/* compare the two */
|
|
if (memcmp(orig, digest, EIGRP_AUTH_TYPE_MD5_LEN) != 0) {
|
|
@@ -262,7 +278,11 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
|
|
unsigned char digest[EIGRP_AUTH_TYPE_SHA256_LEN];
|
|
unsigned char buffer[1 + PLAINTEXT_LENGTH + 45 + 1] = {0};
|
|
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+ //TBD when eigrpd crypto is fixed in upstream
|
|
+#elif CRYPTO_INTERNAL
|
|
HMAC_SHA256_CTX ctx;
|
|
+#endif
|
|
void *ibuf;
|
|
size_t backup_get, backup_end;
|
|
struct TLV_SHA256_Authentication_Type *auth_TLV;
|
|
@@ -291,6 +311,9 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
|
|
|
|
inet_ntop(AF_INET, &ei->address.u.prefix4, source_ip, PREFIX_STRLEN);
|
|
|
|
+#ifdef CRYPTO_OPENSSL
|
|
+ //TBD when eigrpd crypto is fixed in upstream
|
|
+#elif CRYPTO_INTERNAL
|
|
memset(&ctx, 0, sizeof(ctx));
|
|
buffer[0] = '\n';
|
|
memcpy(buffer + 1, key, strlen(key->string));
|
|
@@ -299,7 +322,7 @@ int eigrp_make_sha256_digest(struct eigrp_interface *ei, struct stream *s,
|
|
1 + strlen(key->string) + strlen(source_ip));
|
|
HMAC__SHA256_Update(&ctx, ibuf, strlen(ibuf));
|
|
HMAC__SHA256_Final(digest, &ctx);
|
|
-
|
|
+#endif
|
|
|
|
/* Put hmac-sha256 digest to it's place */
|
|
memcpy(auth_TLV->digest, digest, EIGRP_AUTH_TYPE_SHA256_LEN);
|
|
diff --git a/eigrpd/eigrp_query.c b/eigrpd/eigrp_query.c
|
|
index c8769fb11..cd31fa839 100644
|
|
--- a/eigrpd/eigrp_query.c
|
|
+++ b/eigrpd/eigrp_query.c
|
|
@@ -38,7 +38,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "vty.h"
|
|
|
|
#include "eigrpd/eigrp_structs.h"
|
|
diff --git a/eigrpd/eigrp_reply.c b/eigrpd/eigrp_reply.c
|
|
index 015daa768..ebf33e04e 100644
|
|
--- a/eigrpd/eigrp_reply.c
|
|
+++ b/eigrpd/eigrp_reply.c
|
|
@@ -42,7 +42,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "vty.h"
|
|
#include "keychain.h"
|
|
#include "plist.h"
|
|
diff --git a/eigrpd/eigrp_siaquery.c b/eigrpd/eigrp_siaquery.c
|
|
index 9c2a8c9d8..d1d50a617 100644
|
|
--- a/eigrpd/eigrp_siaquery.c
|
|
+++ b/eigrpd/eigrp_siaquery.c
|
|
@@ -38,7 +38,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "vty.h"
|
|
|
|
#include "eigrpd/eigrp_structs.h"
|
|
diff --git a/eigrpd/eigrp_siareply.c b/eigrpd/eigrp_siareply.c
|
|
index 2d298c20b..556fb3f3e 100644
|
|
--- a/eigrpd/eigrp_siareply.c
|
|
+++ b/eigrpd/eigrp_siareply.c
|
|
@@ -37,7 +37,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "vty.h"
|
|
|
|
#include "eigrpd/eigrp_structs.h"
|
|
diff --git a/eigrpd/eigrp_snmp.c b/eigrpd/eigrp_snmp.c
|
|
index 9ada292fe..1d0637019 100644
|
|
--- a/eigrpd/eigrp_snmp.c
|
|
+++ b/eigrpd/eigrp_snmp.c
|
|
@@ -42,7 +42,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "keychain.h"
|
|
#include "smux.h"
|
|
|
|
diff --git a/eigrpd/eigrp_update.c b/eigrpd/eigrp_update.c
|
|
index 0dc509706..cbabe3a3c 100644
|
|
--- a/eigrpd/eigrp_update.c
|
|
+++ b/eigrpd/eigrp_update.c
|
|
@@ -42,7 +42,9 @@
|
|
#include "log.h"
|
|
#include "sockopt.h"
|
|
#include "checksum.h"
|
|
+#ifdef CRYPTO_INTERNAL
|
|
#include "md5.h"
|
|
+#endif
|
|
#include "vty.h"
|
|
#include "plist.h"
|
|
#include "plist_int.h"
|