View | Details | Raw Unified | Return to bug 257653
Collapse All | Expand All

(-)b/security/gvm-libs/files/patch-util_passwordbasedauthentication.c (-3 / +18 lines)
Lines 1-14 Link Here
1
--- util/passwordbasedauthentication.c	2021-07-08 17:07:24.145438000 -0500
1
--- util/passwordbasedauthentication.c.orig	2021-06-23 12:41:48 UTC
2
+++ util/passwordbasedauthentication.c	2021-07-08 17:08:24.809605000 -0500
2
+++ util/passwordbasedauthentication.c
3
@@ -26,7 +26,11 @@
3
@@ -26,7 +26,13 @@
4
 // UFC_crypt defines crypt_r when only when __USE_GNU is set
4
 // UFC_crypt defines crypt_r when only when __USE_GNU is set
5
 // this shouldn't affect other implementations
5
 // this shouldn't affect other implementations
6
 #define __USE_GNU
6
 #define __USE_GNU
7
+#if defined(__FreeBSD__)
7
+#if defined(__FreeBSD__)
8
+#if HAS_CRYPT_R
8
+#include <unistd.h>
9
+#include <unistd.h>
10
+#endif
9
+#else
11
+#else
10
 #include <crypt.h>
12
 #include <crypt.h>
11
+#endif
13
+#endif
12
 // INVALID_HASH is used on verify when the given hash is a NULL pointer.
14
 // INVALID_HASH is used on verify when the given hash is a NULL pointer.
13
 // This is done to not directly jump to exit with a INVALID_HASH result
15
 // This is done to not directly jump to exit with a INVALID_HASH result
14
 // but rather keep calculating to make it a little bit harder to guess
16
 // but rather keep calculating to make it a little bit harder to guess
17
@@ -173,6 +179,7 @@ pba_is_phc_compliant (const char *settin
18
   return strlen (setting) > 1 && setting[0] == '$';
19
 }
20
 
21
+#if HAS_CRYPT_R
22
 char *
23
 pba_hash (struct PBASettings *setting, const char *password)
24
 {
25
@@ -276,3 +283,4 @@ exit:
26
     free (tmp);
27
   return result;
28
 }
29
+#endif /* #if HAS_CRYPT_R */
(-)b/security/gvm-libs/files/patch-util_passwordbasedauthentication.h (+21 lines)
Added Link Here
1
Don't compile pba_hash and pba_verify_hash() on FreeBSD 11.x which
2
(currently) does not have crypt_r(3).
3
4
This can be removed when support for 11.x is no longer needed in the
5
ports tree.
6
7
--- util/passwordbasedauthentication.h.orig	2021-06-23 12:41:48 UTC
8
+++ util/passwordbasedauthentication.h
9
@@ -18,6 +18,12 @@
10
 #ifndef _GVM_PASSWORDBASEDAUTHENTICATION_H
11
 #define _GVM_PASSWORDBASEDAUTHENTICATION_H
12
 
13
+#if defined(__FreeBSD__) && __FreeBSD__ < 12
14
+#define HAS_CRYPT_R 0
15
+#else
16
+#define HAS_CRYPT_R 1
17
+#endif
18
+
19
 /* max amount of applied pepper */
20
 #define MAX_PEPPER_SIZE 4
21
 /* is used when count is 0 on init*/

Return to bug 257653