diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-01-16 10:38:03 -0500 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-01-16 10:38:03 -0500 |
commit | fbc17fa1d962150062aa0b4839d75a27605b965e (patch) | |
tree | fe0b592698e1c2198b6af517782f7c8608065759 /src/c | |
parent | 3af8bcda28c4c831cf420ebba926dd9ac1f44d71 (diff) |
Patch from Vladimir Shabanov to support crypt under OS X
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/urweb.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index 38733cc4..9f5c009a 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -13,7 +13,7 @@ #include <stdint.h> #include <sys/types.h> #include <sys/socket.h> -#include <crypt.h> +#include <openssl/des.h> #include <time.h> #include <pthread.h> @@ -3697,15 +3697,8 @@ failure_kind uw_runCallback(uw_context ctx, void (*callback)(uw_context)) { } uw_Basis_string uw_Basis_crypt(uw_context ctx, uw_Basis_string key, uw_Basis_string salt) { - struct crypt_data *data; - - if ((data = uw_get_global(ctx, "crypt")) == NULL) { - data = malloc(sizeof(struct crypt_data)); - data->initialized = 0; - uw_set_global(ctx, "crypt", data, free); - } - - return uw_strdup(ctx, crypt_r(key, salt, data)); + char buf[14]; + return uw_strdup(ctx, DES_fcrypt(key, salt, buf)); } uw_Basis_bool uw_Basis_eq_time(uw_context ctx, uw_Basis_time t1, uw_Basis_time t2) { |