Skip to content

Commit b04277b

Browse files
chore: Add review feedback
Throw when one of the headers are empty Enumerate all the allowed algorithms in th NATIVE constant Co-authored-by: Carl Schwan <carl@carlschwan.eu> Signed-off-by: Micke Nordin <kano@sunet.se>
1 parent bc6ca57 commit b04277b

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

lib/private/Security/Signature/Model/Rfc9421IncomingSignedRequest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ private function collectHeaders(): array {
306306
if ($value === '' && strtolower($component) === 'host') {
307307
$value = $this->request->getServerHost();
308308
}
309+
if ($value === '') {
310+
throw new IncomingRequestException('covered header is missing or empty: ' . $component);
311+
}
309312
$out[strtolower($component)] = $value;
310313
}
311314
return $out;

lib/private/Security/Signature/Rfc9421/Algorithm.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
final class Algorithm {
3232
public const NATIVE = [
3333
'rsa-v1_5-sha256',
34+
'rsa-v1_5-sha384',
35+
'rsa-v1_5-sha512',
3436
'ecdsa-p256-sha256',
3537
'ecdsa-p384-sha384',
3638
'ed25519',

0 commit comments

Comments
 (0)