[pLog-svn] r1964 - plugins/trunk/atom/class/xml/atom

oscar at devel.plogworld.net oscar at devel.plogworld.net
Fri May 6 23:07:00 GMT 2005


Author: oscar
Date: 2005-05-06 23:06:59 +0000 (Fri, 06 May 2005)
New Revision: 1964

Modified:
   plugins/trunk/atom/class/xml/atom/wsseauthentication.class.php
Log:
You really have to love it when people implement things common open specifications their own way... Ecto likes to send the "nonce" bit of the WSSE authentication base64'ed while Nokia's Lifeblog doesn't, so the authentication algorithm has to calculate both password digests and see which one of them is right...

Modified: plugins/trunk/atom/class/xml/atom/wsseauthentication.class.php
===================================================================
--- plugins/trunk/atom/class/xml/atom/wsseauthentication.class.php	2005-05-06 22:57:51 UTC (rev 1963)
+++ plugins/trunk/atom/class/xml/atom/wsseauthentication.class.php	2005-05-06 23:06:59 UTC (rev 1964)
@@ -63,11 +63,14 @@
 
             // fscking hell, it took me forever to figure out how this worked... 			
 			$passwordDigest = base64_encode(pack("H*",SHA1::sha1(base64_decode($this->nonce).$this->created.$password)));
+			// alternative password digest. Somehow Ecto for OS X will send the nonce in Base64 format while
+			// Nokia's Lifeblog will not. Weird, but all we can do is check for both and see who gets it right!
+			$passwordDigestAlt = base64_encode(pack("H*",SHA1::sha1($this->nonce.$this->created.$password)));
 		
 			AtomLogger::Log( "pLog's computed password digest: $passwordDigest" );
 
 			// finally, compare if they are the same or not...
-			return( $passwordDigest == $this->passwordDigest );
+			return(( $passwordDigest == $this->passwordDigest ) || ( $passwordDigestAlt == $this->passwordDigest ));
 		}
 
 		/**




More information about the pLog-svn mailing list