From 5d0dbfd9dd1e08745109a18cce6a04750ffb7477 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sun, 2 Mar 2003 20:02:02 +0000 Subject: [PATCH] r4147: Auto commit for Debian build --- clsql-postgresql-socket.asd | 4 ++-- db-postgresql-socket/postgresql-socket-api.lisp | 16 +++++++++++++++- debian/changelog | 7 +++++++ debian/control | 2 +- 4 files changed, 25 insertions(+), 4 deletions(-) diff --git a/clsql-postgresql-socket.asd b/clsql-postgresql-socket.asd index c5811fe..b8d0a63 100644 --- a/clsql-postgresql-socket.asd +++ b/clsql-postgresql-socket.asd @@ -7,7 +7,7 @@ ;;;; Programmer: Kevin M. Rosenberg ;;;; Date Started: Aug 2002 ;;;; -;;;; $Id: clsql-postgresql-socket.asd,v 1.14 2002/10/21 07:14:18 kevin Exp $ +;;;; $Id: clsql-postgresql-socket.asd,v 1.15 2003/03/02 20:02:02 kevin Exp $ ;;;; ;;;; This file, part of CLSQL, is Copyright (c) 2002 by Kevin M. Rosenberg ;;;; @@ -38,4 +38,4 @@ :depends-on ("postgresql-socket-package")) (:file "postgresql-socket-sql" :depends-on ("postgresql-socket-api"))))) - :depends-on (:clsql-base :uffi)) + :depends-on (:clsql-base :uffi :md5)) diff --git a/db-postgresql-socket/postgresql-socket-api.lisp b/db-postgresql-socket/postgresql-socket-api.lisp index 4dffc99..658addc 100644 --- a/db-postgresql-socket/postgresql-socket-api.lisp +++ b/db-postgresql-socket/postgresql-socket-api.lisp @@ -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 diff --git a/debian/changelog b/debian/changelog index 3259936..602099b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 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 diff --git a/debian/control b/debian/control index 9979840..42e4760 100644 --- a/debian/control +++ b/debian/control @@ -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 -- 2.34.1