mirror of
https://github.com/friendica/friendica
synced 2025-04-22 19:50:11 +00:00
[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:
parent
a3fb499735
commit
55640eec87
13 changed files with 241 additions and 173 deletions
|
@ -23,11 +23,9 @@ namespace Friendica\Module;
|
|||
|
||||
use Friendica\BaseModule;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\User;
|
||||
use Friendica\Network\HTTPException\BadRequestException;
|
||||
use Friendica\Util\Crypto;
|
||||
use Friendica\Util\Strings;
|
||||
use Friendica\Protocol\Salmon;
|
||||
|
||||
/**
|
||||
* prints the public RSA key of a user
|
||||
|
@ -47,9 +45,10 @@ class PublicRSAKey extends BaseModule
|
|||
throw new BadRequestException();
|
||||
}
|
||||
|
||||
Crypto::pemToMe($user['spubkey'], $modulus, $exponent);
|
||||
|
||||
$content = 'RSA' . '.' . Strings::base64UrlEncode($modulus, true) . '.' . Strings::base64UrlEncode($exponent, true);
|
||||
System::httpExit($content, Response::TYPE_BLANK, 'application/magic-public-key');
|
||||
System::httpExit(
|
||||
Salmon::salmonKey($user['spubkey']),
|
||||
Response::TYPE_BLANK,
|
||||
'application/magic-public-key'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue