Index: misc-stml.scm ================================================================== --- misc-stml.scm +++ misc-stml.scm @@ -131,19 +131,24 @@ ;; (define (s:crypt-passwd pw s) (let* ((salt (if s s (session:make-rand-string 2))) (inp (open-input-pipe ;;(string-append "echo " pw " | mkpasswd -S " salt " -s"))) - (conc "mkpasswd " pw " " salt))) + ;; (conc "mkpasswd " pw " " salt) + (conc "openssl passwd -crypt -salt " salt " " pw) + )) (res (read-line inp))) (close-input-port inp) res)) (define (s:password-match? password crypted) (let* ((salt (substring crypted 0 2)) (pcrypted (s:crypt-passwd password salt))) - (string=? pcrypted crypted))) + (s:log "INFO: pcrypted=" pcrypted " crypted=" crypted) + (and (string? password) + (string? pcrypted) + (string=? pcrypted crypted)))) ;; (read-line (open-input-pipe "echo foo | mkpasswd -S ab -s")) (define (s:error-page . err) (s:cgi-out (cons "Content-type: text/html; charset=iso-8859-1\n\n"