aboutsummaryrefslogtreecommitdiffstats
path: root/include/salmon.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/salmon.php')
-rw-r--r--include/salmon.php13
1 files changed, 10 insertions, 3 deletions
diff --git a/include/salmon.php b/include/salmon.php
index 4043b4f1d..9153f8994 100644
--- a/include/salmon.php
+++ b/include/salmon.php
@@ -73,6 +73,13 @@ function slapper($owner,$url,$slap) {
if(! strlen($url))
return;
+
+ if(! $owner['sprvkey']) {
+ logger(sprintf("slapper: user '%s' (%d) does not have a salmon private key. Send failed.",
+ $owner['username'],$owner['uid']));
+ return;
+ }
+
// add all namespaces to item
$namespaces = <<< EOT
@@ -102,11 +109,11 @@ EOT;
$precomputed = '.YXBwbGljYXRpb24vYXRvbSt4bWw=.YmFzZTY0dXJs.UlNBLVNIQTI1Ng==';
- $signature = base64url_encode(rsa_sign(str_replace('=','',$data . $precomputed),true),$owner['sprvkey']);
+ $signature = base64url_encode(rsa_sign(str_replace('=','',$data . $precomputed),$owner['sprvkey']));
- $signature2 = base64url_encode(rsa_sign($data . $precomputed),$owner['sprvkey']);
+ $signature2 = base64url_encode(rsa_sign($data . $precomputed,$owner['sprvkey']));
- $signature3 = base64url_encode(rsa_sign($data),$owner['sprvkey']);
+ $signature3 = base64url_encode(rsa_sign($data,$owner['sprvkey']));
$salmon_tpl = get_markup_template('magicsig.tpl');