Changeset: bef217d344a0 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=bef217d344a0
Modified Files:
common/utils/mcrypt.c
common/utils/mcrypt.h
monetdb5/mal/mal_authorize.c
Branch: Jun2016
Log Message:
Don't provide digest functions in embedded mode.
That is even if OpenSSL/CommonCrypto is available -- they are then
only used for random number generation.
This is like changeset c88ab11c3676 in the default branch, but different.
diffs (65 lines):
diff --git a/common/utils/mcrypt.c b/common/utils/mcrypt.c
--- a/common/utils/mcrypt.c
+++ b/common/utils/mcrypt.c
@@ -13,7 +13,7 @@
#include "mcrypt.h"
#include <string.h>
-#if defined(HAVE_OPENSSL) || defined(HAVE_COMMONCRYPTO)
+#ifndef HAVE_EMBEDDED
#ifdef HAVE_OPENSSL
#include <openssl/md5.h>
@@ -544,7 +544,9 @@ mcrypt_hashPassword(
#define NO_OPENSSL_FATAL "MonetDB was built without OpenSSL, but what you are
trying to do requires it.\n"
-char* mcrypt_sum_fail(const char *string, size_t len) {
+static char *
+mcrypt_sum_fail(const char *string, size_t len)
+{
(void)string;
(void)len;
fprintf(stderr, NO_OPENSSL_FATAL);
diff --git a/common/utils/mcrypt.h b/common/utils/mcrypt.h
--- a/common/utils/mcrypt.h
+++ b/common/utils/mcrypt.h
@@ -19,7 +19,4 @@ char *mcrypt_SHA512Sum(const char *strin
char *mcrypt_RIPEMD160Sum(const char *string, size_t len);
char *mcrypt_BackendSum(const char *string, size_t len);
char *mcrypt_hashPassword(const char *algo, const char *password, const char
*challenge);
-#ifdef HAVE_EMBEDDED
-char* mcrypt_sum_fail(const char *string, size_t len);
#endif
-#endif
diff --git a/monetdb5/mal/mal_authorize.c b/monetdb5/mal/mal_authorize.c
--- a/monetdb5/mal/mal_authorize.c
+++ b/monetdb5/mal/mal_authorize.c
@@ -786,6 +786,7 @@ AUTHcypherValue(str *ret, str *value)
static str
AUTHverifyPassword(str *passwd)
{
+#ifndef HAVE_EMBEDDED
char *p = *passwd;
size_t len = strlen(p);
@@ -845,10 +846,13 @@ AUTHverifyPassword(str *passwd)
"representation of an MD5 password
hash?");
} else
#endif
+#endif
{
+ (void) passwd;
throw(MAL, "verifyPassword", "Unknown backend hash algorithm:
%s",
MONETDB5_PASSWDHASH);
}
+#ifndef HAVE_EMBEDDED
len++; // required in case all the checks above are false
while (*p != '\0') {
if (!((*p >= 'a' && *p <= 'z') || (*p >= '0' && *p <= '9')))
@@ -859,4 +863,5 @@ AUTHverifyPassword(str *passwd)
}
return(MAL_SUCCEED);
+#endif
}
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list