Skip Menu |

This queue is for tickets about the XML-Compile-WSS CPAN distribution.

Report information
The Basics
Id: 78698
Status: resolved
Priority: 0/
Queue: XML-Compile-WSS

People
Owner: Nobody in particular
Requestors: mcdave [...] stanford.edu
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.13
Fixed in: (no value)



Subject: wsseBasicAuth throws "Unknown encoding" when used with UTP11_PDIGEST
The arguments to "encode" are backwards. It attempts to encode the string "utf8" instead of the password. The patch is simple. This comes against XML-Compiles-WWW-0.13. I'm using Encode version 2.12, in case that's interesting. In the test I wrote, I chose a particular WSDL to work with but there might be a more elegant way to make it. Run the attached "properDigest.t" against the current version and you should get something like Unknown encoding 'bar' at lib/XML/Compile/WSS.pm line 68 RT wants me to tell you about perl -V but I doubt you care that much: [mcdave@epgy-dsk-999 XML-Compile-WSS-0.13]$ perl -V | head -4 Summary of my perl5 (revision 5 version 8 subversion 8) configuration: Platform: osname=linux, osvers=2.6.18-128.1.10.el5, archname=x86_64-linux-thread-multi uname='linux ls20-bc2-13.build.redhat.com 2.6.18-128.1.10.el5 #1 smp wed apr 29 13:53:08 edt 2009 x86_64 x86_64 x86_64 gnulinux '
Subject: digestEncoding.patch
diff --git a/lib/XML/Compile/WSS.pm b/lib/XML/Compile/WSS.pm index f7ef5a4..0250c9a 100644 --- a/lib/XML/Compile/WSS.pm +++ b/lib/XML/Compile/WSS.pm @@ -65,7 +65,7 @@ sub wsseBasicAuth($$;$) my $pwtype = $schema->findName('wsse:Password'); my $untype = $schema->findName('wsse:UsernameToken'); - $password = sha1_base64 encode($password, 'utf8') + $password = sha1_base64 encode('utf8', $password) if $type && $type eq UTP11_PDIGEST; my $doc = XML::LibXML::Document->new('1.0', 'UTF-8'); diff --git a/t/properDigestEncoding.t b/t/properDigestEncoding.t new file mode 100644 index 0000000..45a10dc --- /dev/null +++ b/t/properDigestEncoding.t @@ -0,0 +1,15 @@ +#!/usr/bin/perl +use warnings; +use strict; + +use lib 'lib'; +use Test::More tests => 2; + +use XML::Compile::WSDL11 ; +use XML::Compile::SOAP::WSS ; +use XML::Compile::WSS::Util qw/:wss11 :utp11/ ; + +## How to get a relative path right?? +my $wsdl = XML::Compile::WSDL11->new( 'examples/wsse/example.wsdl' ) ; +ok( my $wss = XML::Compile::SOAP::WSS->new( version => 1.1, schema => $wsdl ), 'Created a WSS object' ) ; +ok( my $sec = $wss->wsseBasicAuth( 'foo', 'bar', UTP11_PDIGEST ), '#PasswordDigest returns something sensible' ) ;
Subject: Re: [rt.cpan.org #78698] wsseBasicAuth throws "Unknown encoding" when used with UTP11_PDIGEST
Date: Tue, 31 Jul 2012 21:56:03 +0200
To: David Tindall Mcmath via RT <bug-XML-Compile-WSS [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* David Tindall Mcmath via RT (bug-XML-Compile-WSS@rt.cpan.org) [120731 19:30]: Show quoted text
> Tue Jul 31 15:29:52 2012: Request 78698 was acted upon. > Transaction: Ticket created by mcdave@stanford.edu > Queue: XML-Compile-WSS > Subject: wsseBasicAuth throws "Unknown encoding" when used with UTP11_PDIGEST
Thanks. Releases for this module are rare, so I have uploaded 0.14 immediately. -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
fixed in 0.14