Permalink
Browse files

Compile on Mac OS X. Supports DES only.

Seriously. man 3 crypt.
  • Loading branch information...
1 parent b9247fa commit b311d6ebfa45ef7608c159e4a5959f86b582c2fe @msantos committed Jan 14, 2010
Showing with 14 additions and 6 deletions.
  1. +6 −5 Makefile
  2. +8 −1 README
View
@@ -5,14 +5,15 @@ APP=crypt
CC=gcc
#Mac OS X: use "-m64" for a 64-bit erlang
-#ARCH=-m32
-#FLAGS=$(ARCH) -O3 -fPIC -bundle -flat_namespace -undefined suppress -fno-common -lcrypt
+ARCH=-m32
+
+# By default, use the system crypt(3), which is DES only
+FLAGS=$(ARCH) -O3 -fPIC -bundle -flat_namespace -undefined suppress -fno-common
# Linux
-FLAGS=-fPIC -shared -lcrypt
+#FLAGS=-fPIC -shared -lcrypt
-#ERL_ROOT=/usr/local/lib/erlang
-ERL_ROOT=/media/opt/local/lib/erlang
+ERL_ROOT=/usr/local/lib/erlang
CFLAGS=-g -Wall
View
9 README
@@ -10,16 +10,23 @@ Eshell V5.7.4 (abort with ^G)
"$6$aaaaaaaa$HREHv6TuSmUS/7spCDO5Js3ssSZ6.iwVkUoVtatJUhJDKVmERrRKBTolrPMub2s5dX6IEjZg6d6wZzFRlidV41"
4>
+Which algorithms are supported by crypt are dependent on the system
+crypt(3) library. For example, Mac OS X only supports DES (booooooo!!!!).
+
TODO
1. What is the maximum password and salt length?
There doesn't appear to be a limit. DES has an 8 character limit and
-MD5 has a 255 character limit, but for the other types, no idea.
+MD5 has a 256 character limit, but for the other types, no idea.
sysconf(_SC_PASS_MAX) seems to return the limit on Solaris, but isn't
available on Ubuntu.
2. Provide an erlang version of the crypt() interface.
+3. For systems that don't support MD5, maybe use openssl (see in
+openssl dist: apps/passwd.c).
+
+

0 comments on commit b311d6e

Please sign in to comment.