diff options
author | Mario Vavti <mario@mariovavti.com> | 2016-02-26 09:21:01 +0100 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2016-02-26 09:21:01 +0100 |
commit | 0653a2e0a9843fdcb8fd079197e5ada975b2cb05 (patch) | |
tree | 8dfc18f61fd1a40d3ed31ec76e397a530fddb714 /include/crypto.php | |
parent | d19dfc87a6c00ebb0434a46664621f0b0585c97b (diff) | |
parent | ba2ede0a8f82be98994f129655dbb78d5c024e47 (diff) | |
download | volse-hubzilla-0653a2e0a9843fdcb8fd079197e5ada975b2cb05.tar.gz volse-hubzilla-0653a2e0a9843fdcb8fd079197e5ada975b2cb05.tar.bz2 volse-hubzilla-0653a2e0a9843fdcb8fd079197e5ada975b2cb05.zip |
Merge branch 'master' of https://github.com/redmatrix/hubzilla
Diffstat (limited to 'include/crypto.php')
-rw-r--r-- | include/crypto.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/crypto.php b/include/crypto.php index 494a2a5b9..50ec2a3a6 100644 --- a/include/crypto.php +++ b/include/crypto.php @@ -21,6 +21,21 @@ function rsa_verify($data,$sig,$key,$alg = 'sha256') { if(intval(OPENSSL_ALGO_SHA256) && $alg === 'sha256') $alg = OPENSSL_ALGO_SHA256; $verify = openssl_verify($data,$sig,$key,$alg); + + if(! $verify) { + logger('openssl_verify: ' . openssl_error_string(),LOGGER_NORMAL,LOG_ERR); + logger('openssl_verify: key: ' . $key, LOGGER_DEBUG, LOG_ERR); + // provide a backtrace so that we can debug key issues + if(version_compare(PHP_VERSION, '5.4.0') >= 0) { + $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); + if($stack) { + foreach($stack as $s) { + logger('stack: ' . basename($s['file']) . ':' . $s['line'] . ':' . $s['function'] . '()',LOGGER_DEBUG,LOG_ERR); + } + } + } + } + return $verify; } |