projects
/
profile
/
ivi
/
syslinux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a53e2a6
)
Allow setting a custom salt
author
hpa
<hpa>
Mon, 24 Jan 2005 19:07:55 +0000
(19:07 +0000)
committer
hpa
<hpa>
Mon, 24 Jan 2005 19:07:55 +0000
(19:07 +0000)
sha1pass
patch
|
blob
|
history
diff --git
a/sha1pass
b/sha1pass
index
10ec8b5
..
76193f1
100755
(executable)
--- a/
sha1pass
+++ b/
sha1pass
@@
-23,7
+23,10
@@
sub random_bytes($) {
return $v;
}
-$salt = MIME::Base64::encode(random_bytes(6), '');
-$pass = Digest::SHA1::sha1_base64($salt, $ARGV[0]);
+
+($pass, $salt) = @ARGV;
+
+$salt = $salt || MIME::Base64::encode(random_bytes(6), '');
+$pass = Digest::SHA1::sha1_base64($salt, $pass);
print '$4$', $salt, '$', $pass, "\$\n";