diff options
author | H. Peter Anvin <hpa@zytor.com> | 2006-10-26 14:39:26 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2006-10-26 14:39:26 -0700 |
commit | 02131f189f079ff3cbf0ad2cb6078ba28871b62f (patch) | |
tree | 29be603dff29c92ad99c93a743ee4c80ee2b3fc6 | |
parent | 0a9bdf66956cff22f334c4f9db4e70c8fc5364ab (diff) | |
download | syslinux.git-02131f189f079ff3cbf0ad2cb6078ba28871b62f.tar.gz syslinux.git-02131f189f079ff3cbf0ad2cb6078ba28871b62f.tar.xz syslinux.git-02131f189f079ff3cbf0ad2cb6078ba28871b62f.zip |
sha1pass: allow the user to specify an empty salt
-rwxr-xr-x | sha1pass | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -26,7 +26,9 @@ sub random_bytes($) { ($pass, $salt) = @ARGV; -$salt = $salt || MIME::Base64::encode(random_bytes(6), ''); +unless (defined($salt)) { + $salt = MIME::Base64::encode(random_bytes(6), ''); +} $pass = Digest::SHA1::sha1_base64($salt, $pass); print '$4$', $salt, '$', $pass, "\$\n"; |