Author: chabotc
Date: Sat Mar 14 17:53:41 2009
New Revision: 754501

URL: http://svn.apache.org/viewvc?rev=754501&view=rev
Log:
Changed the expected number of components with a plain text token to 7, which 
is what the samplecontainer now generates, closes SHINDIG-931

Modified:
    incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php
    incubator/shindig/trunk/php/src/common/sample/BasicSecurityTokenDecoder.php

Modified: incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php?rev=754501&r1=754500&r2=754501&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php 
(original)
+++ incubator/shindig/trunk/php/src/common/sample/BasicBlobCrypter.php Sat Mar 
14 17:53:41 2009
@@ -23,27 +23,27 @@
 
 /**
  * This class provides basic binary blob encryption and decryption, for use 
with the security token
- * 
+ *
  */
 class BasicBlobCrypter extends BlobCrypter {
   //FIXME make this compatible with the java's blobcrypter
-  
+
 
   // Labels for key derivation
   private $CIPHER_KEY_LABEL = 0;
   private $HMAC_KEY_LABEL = 1;
-  
+
   /** Key used for time stamp (in seconds) of data */
   public $TIMESTAMP_KEY = "t";
-  
+
   /** minimum length of master key */
   public $MASTER_KEY_MIN_LEN = 16;
-  
+
   /** allow three minutes for clock skew */
   private $CLOCK_SKEW_ALLOWANCE = 180;
-  
+
   private $UTF8 = "UTF-8";
-  
+
   protected $cipherKey;
   protected $hmacKey;
   protected $allowPlaintextToken;
@@ -83,7 +83,7 @@
    */
   public function unwrap($in, $maxAgeSec) {
     //TODO remove this once we have a better way to generate a fake token in 
the example files
-    if ($this->allowPlaintextToken && count(explode(':', $in)) == 6) {
+    if ($this->allowPlaintextToken && count(explode(':', $in)) == 7) {
       $data = explode(":", $in);
       $out = array();
       $out['o'] = $data[0];

Modified: 
incubator/shindig/trunk/php/src/common/sample/BasicSecurityTokenDecoder.php
URL: 
http://svn.apache.org/viewvc/incubator/shindig/trunk/php/src/common/sample/BasicSecurityTokenDecoder.php?rev=754501&r1=754500&r2=754501&view=diff
==============================================================================
--- incubator/shindig/trunk/php/src/common/sample/BasicSecurityTokenDecoder.php 
(original)
+++ incubator/shindig/trunk/php/src/common/sample/BasicSecurityTokenDecoder.php 
Sat Mar 14 17:53:41 2009
@@ -39,7 +39,7 @@
     try {
       //TODO remove this once we have a better way to generate a fake token
       // in the example files
-      if (Config::get('allow_plaintext_token') && count(explode(':', 
$stringToken)) == 6) {
+      if (Config::get('allow_plaintext_token') && count(explode(':', 
$stringToken)) == 7) {
         $tokens = explode(":", $stringToken);
         return new BasicSecurityToken(null, null, 
urldecode($tokens[$this->OWNER_INDEX]), 
urldecode($tokens[$this->VIEWER_INDEX]), 
urldecode($tokens[$this->APP_ID_INDEX]), 
urldecode($tokens[$this->CONTAINER_INDEX]), 
urldecode($tokens[$this->APP_URL_INDEX]), 
urldecode($tokens[$this->MODULE_ID_INDEX]));
       } else {


Reply via email to