diff --git a/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php b/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php index f7fe6e77..851a9902 100644 --- a/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php +++ b/src/Bundle/JoseFramework/DataCollector/AlgorithmCollector.php @@ -44,7 +44,10 @@ public function __construct(AlgorithmManagerFactory $algorithmManagerFactory) public function collect(array &$data, Request $request, Response $response, \Exception $exception = null) { $algorithms = $this->algorithmManagerFactory->all(); - $data['algorithm']['algorithms'] = []; + $data['algorithm'] = [ + 'messages' => $this->getAlgorithmMessages(), + 'algorithms' => [], + ]; $signatureAlgorithms = 0; $keyEncryptionAlgorithms = 0; $contentEncryptionAlgorithms = 0; @@ -92,4 +95,37 @@ private function getAlgorithmType(Algorithm $algorithm, int &$signatureAlgorithm return 'Unknown'; } } + + /** + * @return array + */ + private function getAlgorithmMessages(): array + { + return [ + 'none' => [ + 'severity' => 'severity-low', + 'message' => 'This algorithm is not secured. Please use with caution.', + ], + 'RSA1_5' => [ + 'severity' => 'severity-high', + 'message' => 'This algorithm is not secured (known attacks). See https://tools.ietf.org/html/draft-irtf-cfrg-webcrypto-algorithms-00#section-5.', + ], + 'ECDH-ES' => [ + 'severity' => 'severity-medium', + 'message' => 'This algorithm is very slow when used with curves P-256, P-384, P-521.', + ], + 'ECDH-ES+A128KW' => [ + 'severity' => 'severity-medium', + 'message' => 'This algorithm is very slow when used with curves P-256, P-384, P-521.', + ], + 'ECDH-ES+A192KW' => [ + 'severity' => 'severity-medium', + 'message' => 'This algorithm is very slow when used with curves P-256, P-384, P-521.', + ], + 'ECDH-ES+A256KW' => [ + 'severity' => 'severity-medium', + 'message' => 'This algorithm is very slow when used with curves P-256, P-384, P-521.', + ], + ]; + } } diff --git a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/checker.html.twig b/src/Bundle/JoseFramework/Resources/views/data_collector/tab/checker.html.twig index 33cb6d3c..9cb90605 100644 --- a/src/Bundle/JoseFramework/Resources/views/data_collector/tab/checker.html.twig +++ b/src/Bundle/JoseFramework/Resources/views/data_collector/tab/checker.html.twig @@ -32,11 +32,24 @@ {% if collector.getData().checker.header_checkers is empty %} No header checker. {% else %} -