aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-12-05 16:44:07 -0800
committerfriendica <info@friendica.com>2012-12-05 16:44:07 -0800
commit1c6f301d8faf2e6a5939e47c7a83655615bfc762 (patch)
tree42705f96df9dde72f25b66ce8031cfaf14a2af31 /include/crypto.php
parente17ba14696d6ee7532bacce6b5519594e001f13f (diff)
downloadvolse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.tar.gz
volse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.tar.bz2
volse-hubzilla-1c6f301d8faf2e6a5939e47c7a83655615bfc762.zip
y'all got mail
Diffstat (limited to 'include/crypto.php')
-rw-r--r--include/crypto.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/crypto.php b/include/crypto.php
index c5901f085..a646910a1 100644
--- a/include/crypto.php
+++ b/include/crypto.php
@@ -4,7 +4,8 @@ require_once('library/ASNValue.class.php');
require_once('library/asn1.php');
function rsa_sign($data,$key,$alg = 'sha256') {
-
+ if(! $key)
+ return 'no key';
$sig = '';
openssl_sign($data,$sig,$key,$alg);
return $sig;
@@ -12,6 +13,9 @@ function rsa_sign($data,$key,$alg = 'sha256') {
function rsa_verify($data,$sig,$key,$alg = 'sha256') {
+ if(! $key)
+ return false;
+
$verify = openssl_verify($data,$sig,$key,$alg);
return $verify;
}