I did a little workaround that will permit me to continue development though I would have preferred it to work as is.
I base64 encode the result of the hash in the return of the derive function then I decode it when I need it. It someone has a better idea to solve this that would be appreciated. On 11 jan, 16:01, David Brisebois <[email protected]> wrote: > I tested the 1.3 alpha and I get the same result... and did the same > with 1.1.20 and the dump get shown ! > > So I guess it is more likely to be a bug since the rewrite to 1.2 > branch, don't you think ? > > On 11 jan, 14:59, John Andersen <[email protected]> wrote: > > > > > A follow-up! It is not dependent on the variable name, but I did > > configure PHP first, so maybe that is the error you get! > > > I activated extension=php_mhash.dll in the PHP configuration! Please > > check that yours is active! > > Enjoy, > > John > > > On Jan 11, 9:54 pm, John Andersen <[email protected]> wrote: > > > > Just tried the following code, it works :) Only change is that I don't > > > use the variable $key! > > > > [code] > > > $hashCode = mhash(MHASH_SHA256, 'ENCRYPTIONISAGOODTHING', > > > true); > > > pr($hashCode); > > > [/code] > > > > Or now that I look at it, maybe that your are using $key both as input > > > and output! Check it out! :) > > > Enjoy, > > > John > > > > On Jan 11, 9:28 pm, David Brisebois <[email protected]> wrote: > > > > > Thanks for your answer ! > > > > > For the error, I was using $this->cakeError() but I taught it was the > > > > problem so that's why I replaced them with the comment so it is easy > > > > to put the error back. > > > > > When reading your answer I made some search to find out that the mhash > > > > type exists, but that it is deprecated for hash so I changed it, set > > > > the third parameter to true (I need the raw binary result) and... same > > > > error ! I really thing the problem is the that I need the binary > > > > result because when I set it to false (to get hexadecimal) everything > > > > works fine except the Live ID token can't be decoded since the key is > > > > not the wright one... > > > > > Any idea ? > > > > > On 11 jan, 13:34, John Andersen <[email protected]> wrote: > > > > > > Are you sure that the mhash type MHASH_SHA256 exists? > > > > > Instead of just commenting out THROW ERROR, make a return( null ); > > > > > Enjoy, > > > > > John > > > > > > On Jan 11, 5:40 am, David Brisebois <[email protected]> wrote: > > > > > > > Hi there ! > > > > > > > I am "baking" up a new website which will use the Windows Live ID > > > > > > Web > > > > > > Authentification service in order to access the web site. Based on > > > > > > the > > > > > > PHP file provided in the SDK, I made my own component which works > > > > > > fairly well (it still need some optimization). > > > > > > > The only weird thing is that calling the function that derives the > > > > > > secret key to use the service make the Controller dump disappear. I > > > > > > tries everything, from changing function names, doing the logic in > > > > > > startup or with a direct call... and so on. But I found that the > > > > > > problem is when I try to save the deriviated key to an attribute... > > > > > > To > > > > > > help you understand here are the two method as they are now : > > > > > > > function set_key() > > > > > > { > > > > > > $this->derive( 'SIGNATURE' ); > > > > > > $this->crypt_key = $this->derive( 'ENCRYPTION' ); > > > > > > } > > > > > > > function derive( $prefix = null ) > > > > > > { > > > > > > if ( is_null( $prefix ) ) { > > > > > > //THROW ERROR > > > > > > } > > > > > > > $length = 16; > > > > > > $key = $prefix . $this->app_key; > > > > > > $key = mhash( MHASH_SHA256, $key ); > > > > > > if ( !$key || ( strlen($key) < $length ) ) > > > > > > { > > > > > > //THROW ERROR > > > > > > } > > > > > > > return substr($key, 0, $length); > > > > > > } > > > > > > > If you use the code as shown above, the dump is hiden, if you > > > > > > comment > > > > > > out the second call to derive() in the set_key() function, it is > > > > > > not... but I really need them to be stored in an attribute ! > > > > > > > Any idea on what happens ? > > > > > > > Thanks.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
