Hi Graham, hi Chris, hi list,

I shouldn't have begged for a new relaese to be cut so quickly.

Here's a set of new patches against Authen::SASL.

The first one - Authen-SASL-2.08-import.patch - uses the import routine to 
select the plugins and/or their order to be used in Authen::SASL.
This patch has been tested during the creation of the patch that led to 
Authen::SASL 2.08.

The other one - Authen-SASL-2.08-digestmd5.patch - adds the possibility to 
authenticate as one person for another person using the authname callback (as 
in Authen::SASL::Perl::Plain) to Authen::SASL::Perl::DIGEST_MD5.pm.
Unfortunately I have not had the time to test this patch yet, but if I 
interpreted the RFC correctly it should work ;-)

Yours
Peter

-- 
Peter Marschall
eMail: [EMAIL PROTECTED]
# allow option authzid in Digest MD5 SASL mech
--- lib/Authen/SASL/Perl/DIGEST_MD5.pm
+++ lib/Authen/SASL/Perl/DIGEST_MD5.pm	2004-05-28 22:00:10.000000000 +0200
@@ -19,7 +19,7 @@
 );
 
 # some have to be quoted - some don't - sigh!
-my %qdval; @qdval{qw(username realm nonce cnonce digest-uri)} = ();
+my %qdval; @qdval{qw(username authzid realm nonce cnonce digest-uri)} = ();
 
 sub _order { 3 }
 sub _secflags {
@@ -66,6 +66,11 @@
     charset      => $sparams{'charset'},
   );
 
+  my $authzid = $self->_call('authname');
+  if (defined $authzid) {
+    $response{authzid} = $authzid;
+  }
+
   my $serv_name = $self->_call('serv');
   if (defined $serv_name) {
     $response{'digest_uri'} .= '/' . $serv_name;
@@ -77,7 +82,7 @@
 
   my $A1 = join (":", 
     md5(join (":", @response{qw(username realm)}, $password)),
-    @response{qw(nonce cnonce)}
+    @response{defined($authzid) ? qw(nonce cnonce authzid) : qw(nonce cnonce)}
   );
 
   my $A2 = "AUTHENTICATE:" . $response{'digest-uri'};
--- lib/Authen/SASL.pm
+++ lib/Authen/SASL.pm	2004-05-24 01:37:14.000000000 +0200
@@ -15,6 +15,17 @@
 	Authen::SASL::Perl
 );
 
+
+sub import {
+  my @plugs = ();
+
+  foreach my $pkg (@_) {
+    push(@plugs, $pkg)  if (eval "require $pkg");
+  }
+  @Plugins = @plugs  if (@plugs);
+}
+
+
 sub new {
   my $pkg = shift;
   my %opt = ((@_ % 2 ? 'mechanism' : ()), @_);
--- lib/Authen/SASL.pod
+++ lib/Authen/SASL.pod	2004-05-25 15:03:48.000000000 +0200
@@ -39,6 +39,20 @@
 
 =back
 
+By default the order in which these plugins are selected is 
+Authen::SASL::Cyrus first and then Authen::SASL::Perl.
+
+If you want to change it or want to specifically use one
+implementation only simply do
+
+ use Authen::SASL  qw/Authen::SASL::Perl/;
+
+or
+
+ require Authen::SASL;
+ Authen::SASL::import(qw/Authen::SASL::Perl/);
+
+
 =head2 CONTRUCTOR
 
 The contructor may be called with or without arguments. Passing arguments is

Reply via email to