diff options
author | Friendika <info@friendika.com> | 2011-08-07 16:15:54 -0700 |
---|---|---|
committer | Friendika <info@friendika.com> | 2011-08-07 16:15:54 -0700 |
commit | 48ffa880f099b19052f18e399bf6af50780a24b0 (patch) | |
tree | 48f5e9b52b425af937b5ae2511aaaf6968e0b666 /mod/salmon.php | |
parent | aa3a14ec36db5f9df9d0ec27c607a994451fc845 (diff) | |
download | volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.tar.gz volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.tar.bz2 volse-hubzilla-48ffa880f099b19052f18e399bf6af50780a24b0.zip |
cleanup
Diffstat (limited to 'mod/salmon.php')
-rw-r--r-- | mod/salmon.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/mod/salmon.php b/mod/salmon.php index 300ad8746..514653be3 100644 --- a/mod/salmon.php +++ b/mod/salmon.php @@ -134,7 +134,14 @@ function salmon_post(&$a) { // Setup RSA stuff to verify the signature - set_include_path(get_include_path() . PATH_SEPARATOR . 'library/phpsec'); + require_once('library/phpsec/Crypt/RSA.php'); + + $rsa = new CRYPT_RSA(); + $rsa->signatureMode = CRYPT_RSA_SIGNATURE_PKCS1; + $rsa->setHash('sha256'); + $rsa->loadKey($prvkey); + + $sig = $rsa->sign($data); require_once('library/phpsec/Crypt/RSA.php'); @@ -194,7 +201,7 @@ function salmon_post(&$a) { // is this a follower? Or have we ignored the person? // If so we can not accept this post. - if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == REL_VIP) || ($r[0]['blocked']))) { + if((count($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) { logger('mod-salmon: Ignoring this author.'); salmon_return(202); // NOTREACHED |