mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 00:55:19 +00:00
provide a way to disable hs2019 for federation testing.
This commit is contained in:
parent
8de852c189
commit
b5c820623f
1 changed files with 8 additions and 1 deletions
|
@ -510,6 +510,7 @@ class HTTPSig
|
|||
|
||||
$return_headers = [];
|
||||
|
||||
|
||||
if ($alg === 'sha256') {
|
||||
$algorithm = 'rsa-sha256';
|
||||
}
|
||||
|
@ -517,9 +518,15 @@ class HTTPSig
|
|||
$algorithm = 'rsa-sha512';
|
||||
}
|
||||
|
||||
// Use hs2019 by default.
|
||||
|
||||
if (get_config('system','use_hs2019',true) && $algorithm === 'rsa-sha512') {
|
||||
$algorithm = 'hs2019';
|
||||
}
|
||||
|
||||
$x = self::sign($head, $prvkey, $alg);
|
||||
|
||||
$headerval = 'keyId="' . $keyid . '",algorithm="' . (($algorithm === 'rsa-sha256') ? 'hs2019' : $algorithm) . '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"';
|
||||
$headerval = 'keyId="' . $keyid . '",algorithm="' . $algorithm . '",headers="' . $x['headers'] . '",signature="' . $x['signature'] . '"';
|
||||
|
||||
if ($encryption) {
|
||||
$x = Crypto::encapsulate($headerval, $encryption['key'], $encryption['algorithm']);
|
||||
|
|
Loading…
Reference in a new issue