|
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 */ |