2024-03-27 18:58:32 +00:00
|
|
|
Index: gnutls-3.8.4/lib/fips.c
|
2023-05-25 13:43:53 +00:00
|
|
|
===================================================================
|
2024-03-27 18:58:32 +00:00
|
|
|
--- gnutls-3.8.4.orig/lib/fips.c
|
|
|
|
+++ gnutls-3.8.4/lib/fips.c
|
|
|
|
@@ -175,20 +175,32 @@ struct hmac_entry {
|
2023-05-30 08:25:26 +00:00
|
|
|
struct hmac_file {
|
|
|
|
int version;
|
|
|
|
struct hmac_entry gnutls;
|
|
|
|
+#if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
2023-05-30 08:25:26 +00:00
|
|
|
struct hmac_entry nettle;
|
|
|
|
struct hmac_entry hogweed;
|
2024-03-27 18:58:32 +00:00
|
|
|
#ifdef GMP_LIBRARY_SONAME
|
2023-05-30 08:25:26 +00:00
|
|
|
struct hmac_entry gmp;
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
2023-05-30 08:25:26 +00:00
|
|
|
+#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct lib_paths {
|
|
|
|
char gnutls[GNUTLS_PATH_MAX];
|
|
|
|
+#if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
2023-05-30 08:25:26 +00:00
|
|
|
char nettle[GNUTLS_PATH_MAX];
|
|
|
|
char hogweed[GNUTLS_PATH_MAX];
|
2024-03-27 18:58:32 +00:00
|
|
|
#ifdef GMP_LIBRARY_SONAME
|
2023-05-30 08:25:26 +00:00
|
|
|
char gmp[GNUTLS_PATH_MAX];
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
2023-05-30 08:25:26 +00:00
|
|
|
+#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -248,6 +252,11 @@ static int handler(void *user, const cha
|
2023-05-30 08:25:26 +00:00
|
|
|
}
|
|
|
|
} else if (!strcmp(section, GNUTLS_LIBRARY_NAME)) {
|
|
|
|
return lib_handler(&p->gnutls, section, name, value);
|
|
|
|
+#if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
2023-05-30 08:25:26 +00:00
|
|
|
} else if (!strcmp(section, NETTLE_LIBRARY_NAME)) {
|
|
|
|
return lib_handler(&p->nettle, section, name, value);
|
|
|
|
} else if (!strcmp(section, HOGWEED_LIBRARY_NAME)) {
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -256,6 +265,7 @@ static int handler(void *user, const cha
|
2023-05-30 08:25:26 +00:00
|
|
|
} else if (!strcmp(section, GMP_LIBRARY_NAME)) {
|
|
|
|
return lib_handler(&p->gmp, section, name, value);
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
2023-05-30 08:25:26 +00:00
|
|
|
+#endif
|
|
|
|
} else {
|
|
|
|
return 0;
|
|
|
|
}
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -401,6 +411,11 @@ static int callback(struct dl_phdr_info
|
2023-05-30 08:25:26 +00:00
|
|
|
|
|
|
|
if (!strcmp(soname, GNUTLS_LIBRARY_SONAME))
|
|
|
|
_gnutls_str_cpy(paths->gnutls, GNUTLS_PATH_MAX, path);
|
|
|
|
+#if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
2023-05-30 08:25:26 +00:00
|
|
|
else if (!strcmp(soname, NETTLE_LIBRARY_SONAME))
|
|
|
|
_gnutls_str_cpy(paths->nettle, GNUTLS_PATH_MAX, path);
|
|
|
|
else if (!strcmp(soname, HOGWEED_LIBRARY_SONAME))
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -409,6 +424,7 @@ static int callback(struct dl_phdr_info
|
2023-05-30 08:25:26 +00:00
|
|
|
else if (!strcmp(soname, GMP_LIBRARY_SONAME))
|
|
|
|
_gnutls_str_cpy(paths->gmp, GNUTLS_PATH_MAX, path);
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
2023-05-30 08:25:26 +00:00
|
|
|
+#endif
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -421,6 +437,11 @@ static int load_lib_paths(struct lib_pat
|
2023-05-30 08:25:26 +00:00
|
|
|
_gnutls_debug_log("Gnutls library path was not found\n");
|
|
|
|
return gnutls_assert_val(GNUTLS_E_FILE_ERROR);
|
|
|
|
}
|
|
|
|
+#if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
2023-05-30 08:25:26 +00:00
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
|
|
|
if (paths->nettle[0] == '\0') {
|
|
|
|
_gnutls_debug_log("Nettle library path was not found\n");
|
|
|
|
return gnutls_assert_val(GNUTLS_E_FILE_ERROR);
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -435,6 +456,7 @@ static int load_lib_paths(struct lib_pat
|
2023-05-30 08:25:26 +00:00
|
|
|
return gnutls_assert_val(GNUTLS_E_FILE_ERROR);
|
|
|
|
}
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
2023-05-30 08:25:26 +00:00
|
|
|
+#endif
|
2024-03-27 18:58:32 +00:00
|
|
|
|
2023-05-30 08:25:26 +00:00
|
|
|
return GNUTLS_E_SUCCESS;
|
|
|
|
}
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -481,6 +503,11 @@ static int check_binary_integrity(void)
|
2023-05-25 13:43:53 +00:00
|
|
|
ret = check_lib_hmac(&hmac.gnutls, paths.gnutls);
|
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
|
|
|
+# if 0
|
2024-03-27 18:58:32 +00:00
|
|
|
+ /* Disable nettle, hogweed and gmp HMAC verification as
|
2023-05-25 13:43:53 +00:00
|
|
|
+ * they are calculated during build of the respective
|
|
|
|
+ * packages and can differ from the ones listed here.
|
|
|
|
+ */
|
|
|
|
ret = check_lib_hmac(&hmac.nettle, paths.nettle);
|
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
2024-03-27 18:58:32 +00:00
|
|
|
@@ -492,6 +519,7 @@ static int check_binary_integrity(void)
|
2023-05-25 13:43:53 +00:00
|
|
|
if (ret < 0)
|
|
|
|
return ret;
|
2024-03-27 18:58:32 +00:00
|
|
|
#endif
|
|
|
|
+#endif
|
2023-05-25 13:43:53 +00:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|