From 9195ea26b1551c57f5686547954db6a8b03d61b9 Mon Sep 17 00:00:00 2001 From: rabuzarus Date: Tue, 19 Jun 2018 13:30:55 +0200 Subject: [PATCH] port hubzillas OpenWebAuth - add some notes to the doxygen to refer to hubzilla's source code --- src/Model/Profile.php | 4 ++++ src/Module/Magic.php | 5 +++++ src/Module/Owa.php | 2 ++ src/Util/Crypto.php | 20 ++++++++++++++++++++ src/Util/HTTPHeaders.php | 3 +++ src/Util/HTTPSig.php | 2 ++ 6 files changed, 36 insertions(+) diff --git a/src/Model/Profile.php b/src/Model/Profile.php index cb1a15afd3..0064a75c30 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -987,6 +987,8 @@ class Profile * redirects the visitor to his/her instance to start the magic auth (Authentication) * process. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/channel.php + * * @param App $a Application instance. */ public static function zrlInit(App $a) @@ -1055,6 +1057,8 @@ class Profile /** * OpenWebAuth authentication. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/zid.php + * * @param string $token */ public static function owtInit($token) diff --git a/src/Module/Magic.php b/src/Module/Magic.php index fef970da1c..1b364a3319 100644 --- a/src/Module/Magic.php +++ b/src/Module/Magic.php @@ -12,6 +12,11 @@ use Friendica\Util\Network; use dba; +/** + * Magic Auth (remote authentication) module. + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Module/Magic.php + */ class Magic extends BaseModule { public static function init() diff --git a/src/Module/Owa.php b/src/Module/Owa.php index 27c863e1b7..337c0554fe 100644 --- a/src/Module/Owa.php +++ b/src/Module/Owa.php @@ -23,6 +23,8 @@ use dba; * If the signature verifies a token is returned. * * This token may be exchanged for an authenticated cookie. + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Module/Owa.php */ class Owa extends BaseModule { diff --git a/src/Util/Crypto.php b/src/Util/Crypto.php index 2dc9783626..d1344fc224 100644 --- a/src/Util/Crypto.php +++ b/src/Util/Crypto.php @@ -251,6 +251,8 @@ class Crypto /** * Encrypt a string with 'aes-256-cbc' cipher method. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php + * * @param string $data * @param string $key The key used for encryption. * @param string $iv A non-NULL Initialization Vector. @@ -265,6 +267,8 @@ class Crypto /** * Decrypt a string with 'aes-256-cbc' cipher method. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php + * * @param string $data * @param string $key The key used for decryption. * @param string $iv A non-NULL Initialization Vector. @@ -279,6 +283,8 @@ class Crypto /** * Encrypt a string with 'aes-256-ctr' cipher method. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php + * * @param string $data * @param string $key The key used for encryption. * @param string $iv A non-NULL Initialization Vector. @@ -295,6 +301,8 @@ class Crypto /** * Decrypt a string with 'aes-256-cbc' cipher method. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php + * * @param string $data * @param string $key The key used for decryption. * @param string $iv A non-NULL Initialization Vector. @@ -309,6 +317,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param string $data * @param string $pubkey The public key. @@ -325,6 +335,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param type $data * @param type $pubkey The public key. @@ -374,6 +386,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param string $data * @param string $pubkey @@ -406,6 +420,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param string $data * @param string $prvkey The private key used for decryption. @@ -426,6 +442,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param string $data * @param string $prvkey The private key used for decryption. @@ -451,6 +469,8 @@ class Crypto } /** + * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/include/crypto.php * * @param array $data * @param string $prvkey The private key used for decryption. diff --git a/src/Util/HTTPHeaders.php b/src/Util/HTTPHeaders.php index a6c270d136..ac2d41be4e 100644 --- a/src/Util/HTTPHeaders.php +++ b/src/Util/HTTPHeaders.php @@ -4,6 +4,9 @@ */ namespace Friendica\Util; +/** + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Web/HTTPHeaders.php + */ class HTTPHeaders { private $in_progress = []; diff --git a/src/Util/HTTPSig.php b/src/Util/HTTPSig.php index 18f3821213..96ea2afb5c 100644 --- a/src/Util/HTTPSig.php +++ b/src/Util/HTTPSig.php @@ -14,6 +14,8 @@ use dba; /** * @brief Implements HTTP Signatures per draft-cavage-http-signatures-07. * + * Ported from Hubzilla: https://framagit.org/hubzilla/core/blob/master/Zotlabs/Web/HTTPSig.php + * * @see https://tools.ietf.org/html/draft-cavage-http-signatures-07 */ -- 2.39.5