r4147: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 2 Mar 2003 20:02:02 +0000 (20:02 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 2 Mar 2003 20:02:02 +0000 (20:02 +0000)
clsql-postgresql-socket.asd
db-postgresql-socket/postgresql-socket-api.lisp
debian/changelog
debian/control

index c5811fe37a028bbc0961c496b47c800b662db9fe..b8d0a63abf768f37d783bc3fe3f6823dc71d7790 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg\r
 ;;;; Date Started:  Aug 2002\r
 ;;;;\r
-;;;; $Id: clsql-postgresql-socket.asd,v 1.14 2002/10/21 07:14:18 kevin Exp $\r
+;;;; $Id: clsql-postgresql-socket.asd,v 1.15 2003/03/02 20:02:02 kevin Exp $\r
 ;;;;\r
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg\r
 ;;;;\r
@@ -38,4 +38,4 @@
                    :depends-on ("postgresql-socket-package"))\r
             (:file "postgresql-socket-sql"\r
                    :depends-on ("postgresql-socket-api")))))\r
-  :depends-on (:clsql-base :uffi))\r
+  :depends-on (:clsql-base :uffi :md5))\r
index 4dffc99241aea6007e3f12af83c43a4e63f3ba30..658addc5ea6cc90c55e81aafc34d51bd4090294a 100644 (file)
@@ -9,7 +9,7 @@
 ;;;;                
 ;;;; Date Started:  Feb 2002
 ;;;;
-;;;; $Id: postgresql-socket-api.lisp,v 1.2 2002/10/21 07:45:50 kevin Exp $
+;;;; $Id: postgresql-socket-api.lisp,v 1.3 2003/03/02 20:02:02 kevin Exp $
 ;;;;
 ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg
 ;;;; and Copyright (c) 1999-2001 by Pierre R. Mai
@@ -391,6 +391,11 @@ troubles."
                               :database database :user user
                               :password (or password ""))))
 
+(defun encrypt-md5 (plaintext salt)
+  (string-downcase
+   (format nil "~{~2,'0X~}"
+          (coerce (md5:md5sum-sequence (concatenate 'string plaintext salt)) 'list))))
+
 (defun reopen-postgresql-connection (connection)
   "Reopen the given PostgreSQL connection.  Closes any existing
 connection, if it is still open."
@@ -429,6 +434,15 @@ connection, if it is still open."
                        socket
                        (crypt-password
                         (postgresql-connection-password connection) salt))))
+                   (5
+                    (let ((salt (make-string 4)))
+                      (read-socket-sequence salt socket)
+                      (let* ((pwd2 (encrypt-md5 (postgresql-connection-password connection)
+                                                (postgresql-connection-user connection)))
+                             (pwd (encrypt-md5 pwd2 salt)))
+                        (send-encrypted-password-message
+                         socket
+                         (concatenate 'string "md5" pwd)))))
                    (t
                     (error 'postgresql-login-error
                            :connection connection
index 3259936382ee3bf81262ee72f6517730682af405..602099b32e59a1d2c87f5718e8a8b18c4357e826 100644 (file)
@@ -1,3 +1,10 @@
+cl-sql (1.4.0-2) unstable; urgency=low
+
+  * Add MD5 support to postgresql socket backend (contributed by
+  Robert Macomber)
+
+ -- Kevin M. Rosenberg <kmr@debian.org>  Sun,  2 Mar 2003 12:59:10 -0700
+
 cl-sql (1.3.0-1) unstable; urgency=low
 
   * uffi/clsql-uffi.lisp: return NIL for numeric fields that are NULL
index 9979840317b2ee15bdb9d99eae78d7087bccb5bd..42e4760a53d6dbe5338332f12594458bb48bc397 100644 (file)
@@ -47,7 +47,7 @@ Description: CLSQL database backend, AODBC
 
 Package: cl-sql-postgresql
 Architecture: all
-Depends: cl-sql-base (>= ${Source-Version}), postgresql-client, cl-sql-uffi (>= ${Source-Version})
+Depends: cl-sql-base (>= ${Source-Version}), postgresql-client, cl-sql-uffi (>= ${Source-Version}), cl-md5
 Provides: cl-sql-backend
 Description: CLSQL database backend, PostgreSQL
  This package enables you to use the CLSQL data access package