1
0
Fork 0

[Composer] Upgrade to phpseclib version 3

- Create custom Key file format for Salmon Magic key
- Remove obsolete pemToME and MEtoPem Crypto methods
- Remove unused newECKeypair Crypto method
- Switch to constant-time Base64 encode/decode in Base64Url Strings methods
This commit is contained in:
Hypolite Petovan 2022-11-23 13:45:58 -05:00
commit 55640eec87
13 changed files with 241 additions and 173 deletions

View file

@ -40,6 +40,7 @@ use Friendica\Protocol\ActivityNamespace;
use Friendica\Protocol\ActivityPub;
use Friendica\Protocol\Email;
use Friendica\Protocol\Feed;
use Friendica\Protocol\Salmon;
use Friendica\Util\Crypto;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Network;
@ -1512,12 +1513,10 @@ class Probe
$pubkey = $curlResult->getBody();
}
$key = explode('.', $pubkey);
try {
$data['pubkey'] = Salmon::magicKeyToPem($pubkey);
} catch (\Throwable $e) {
if (sizeof($key) >= 3) {
$m = Strings::base64UrlDecode($key[1]);
$e = Strings::base64UrlDecode($key[2]);
$data['pubkey'] = Crypto::meToPem($m, $e);
}
}
}