From 1c6f301d8faf2e6a5939e47c7a83655615bfc762 Mon Sep 17 00:00:00 2001 From: friendica Date: Wed, 5 Dec 2012 16:44:07 -0800 Subject: y'all got mail --- include/crypto.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'include/crypto.php') 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; } -- cgit v1.2.3