unexpected openssl result

This commit is contained in:
zotlabs 2018-01-13 13:45:33 -08:00 committed by Mario
parent 750e0a8d11
commit a70db805b7
3 changed files with 3 additions and 2 deletions

View File

@ -38,6 +38,7 @@ class Owa extends \Zotlabs\Web\Controller {
foreach($r as $hubloc) {
$verified = \Zotlabs\Web\HTTPSig::verify('',$hubloc['xchan_pubkey']);
if($verified && $verified['header_signed'] && $verified['header_valid']) {
logger('OWA header: ' . print_r($verified,true));
logger('OWA success: ' . $hubloc['hubloc_addr'],LOGGER_DATA);
$ret['success'] = true;
$token = random_string(32);

View File

@ -117,7 +117,7 @@ class HTTPSig {
logger('verified: ' . $x, LOGGER_DEBUG);
if($x === false)
if(! intval($x))
return $result;
if(! $spoofable)

View File

@ -28,7 +28,7 @@ function rsa_verify($data,$sig,$key,$alg = 'sha256') {
btlogger('openssl_verify: key: ' . $key, LOGGER_DEBUG, LOG_ERR);
}
return $verify;
return (intval($verify) > 0 ? 1 : 0);
}
function pkcs5_pad ($text, $blocksize)