aboutsummaryrefslogtreecommitdiffstats
path: root/include/crypto.php
diff options
context:
space:
mode:
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;
}