summaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorPeter Wemm <peter@FreeBSD.org>2014-09-24 18:12:23 +0000
committerPeter Wemm <peter@FreeBSD.org>2014-09-24 18:12:23 +0000
commitf5bbf7923e42e842c4c6d067e48b2a94bc40de0d (patch)
tree6ea640c5c2b764bc35cadc62d9134dd04f2288be /crypto
parent5bf7090be49a8f79350e8a04ecf260984cb126cf (diff)
Vendor import apr-util-1.5.4 - a minor bug fix release.vendor/apr-util/apr-util-1.5.4
Notes
svn path=/vendor/apr-util/dist/; revision=272074 svn path=/vendor/apr-util/apr-util-1.5.4/; revision=272075; tag=vendor/apr-util/apr-util-1.5.4
Diffstat (limited to 'crypto')
-rw-r--r--crypto/apr_crypto.c2
-rw-r--r--crypto/apr_passwd.c10
2 files changed, 9 insertions, 3 deletions
diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c
index 35ce3752a9b7..fe66582d124f 100644
--- a/crypto/apr_crypto.c
+++ b/crypto/apr_crypto.c
@@ -204,7 +204,7 @@ APU_DECLARE(apr_status_t) apr_crypto_get_driver(
if (err && buffer) {
apr_dso_error(dso, buffer, ERROR_SIZE - 1);
err->msg = buffer;
- err->reason = modname;
+ err->reason = apr_pstrdup(pool, modname);
*result = err;
}
}
diff --git a/crypto/apr_passwd.c b/crypto/apr_passwd.c
index 1b4b47bdf314..c961de2b9349 100644
--- a/crypto/apr_passwd.c
+++ b/crypto/apr_passwd.c
@@ -66,6 +66,12 @@ static void crypt_mutex_unlock(void)
#endif
#endif
+#if defined(WIN32) || defined(BEOS) || defined(NETWARE) || defined(__ANDROID__)
+#define CRYPT_MISSING 1
+#else
+#define CRYPT_MISSING 0
+#endif
+
/*
* Validate a plaintext password against a smashed one. Uses either
* crypt() (if available) or apr_md5_encode() or apr_sha1_base64(), depending
@@ -77,7 +83,7 @@ APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
const char *hash)
{
char sample[200];
-#if !defined(WIN32) && !defined(BEOS) && !defined(NETWARE)
+#if !CRYPT_MISSING
char *crypt_pw;
#endif
if (hash[0] == '$'
@@ -100,7 +106,7 @@ APU_DECLARE(apr_status_t) apr_password_validate(const char *passwd,
/*
* It's not our algorithm, so feed it to crypt() if possible.
*/
-#if defined(WIN32) || defined(BEOS) || defined(NETWARE)
+#if CRYPT_MISSING
return (strcmp(passwd, hash) == 0) ? APR_SUCCESS : APR_EMISMATCH;
#elif defined(CRYPT_R_CRYPTD)
apr_status_t rv;