X-Git-Url: http://git.kpe.io/?p=clsql.git;a=blobdiff_plain;f=db-postgresql-socket%2Fpostgresql-socket-api.lisp;h=7ad32362f2c86da708aebc53d6a83de6100c6939;hp=dabaad923b8bbd59886924ef7ceba182d97fffdf;hb=39095e2eef81a3457756334cea4580026828eaf8;hpb=8a8ee2d7d791b7a3efaed06420802a925d16fca3 diff --git a/db-postgresql-socket/postgresql-socket-api.lisp b/db-postgresql-socket/postgresql-socket-api.lisp index dabaad9..7ad3236 100644 --- a/db-postgresql-socket/postgresql-socket-api.lisp +++ b/db-postgresql-socket/postgresql-socket-api.lisp @@ -214,7 +214,7 @@ socket interface" ;;; Support for encrypted password transmission #-scl -(eval-when (compile eval load) +(eval-when (:compile-toplevel :load-toplevel :execute) (defvar *crypt-library-loaded* nil) (unless *crypt-library-loaded* @@ -426,7 +426,7 @@ troubles." (defun encrypt-md5 (plaintext salt) (string-downcase (format nil "~{~2,'0X~}" - (coerce (md5:md5sum-sequence (concatenate 'string plaintext salt)) 'list)))) + (coerce (md5sum-sequence (concatenate 'string plaintext salt)) 'list)))) (defun reopen-postgresql-connection (connection) "Reopen the given PostgreSQL connection. Closes any existing @@ -458,14 +458,16 @@ connection, if it is still open." (3 (send-unencrypted-password-message socket - (postgresql-connection-password connection))) + (postgresql-connection-password connection)) + (force-output socket)) (4 (let ((salt (make-string 2))) (read-socket-sequence salt socket) (send-encrypted-password-message socket (crypt-password - (postgresql-connection-password connection) salt)))) + (postgresql-connection-password connection) salt))) + (force-output socket)) (5 (let ((salt (make-string 4))) (read-socket-sequence salt socket) @@ -474,7 +476,8 @@ connection, if it is still open." (pwd (encrypt-md5 pwd2 salt))) (send-encrypted-password-message socket - (concatenate 'string "md5" pwd))))) + (concatenate 'string "md5" pwd)))) + (force-output socket)) (t (error 'postgresql-login-error :connection connection