Skip to content
Snippets Groups Projects
Commit 2883e096 authored by Tobias S. Josefowitz's avatar Tobias S. Josefowitz
Browse files

SSL: Do not accept MD2, MD5 and SHA1 signatures any longer

Web browsers and others have distrusted SHA1 a long while ago, MD2 and
MD5 are at this point simply dangerous to support. However, we now
support configuration of supported signature algorithms via
@[SSL.Context] in case any use case simply needs to support older
signature algorithms.
parent 51999431
No related branches found
No related tags found
No related merge requests found
......@@ -264,7 +264,9 @@ int verify_certificate_chain(array(string) certs)
mapping result =
Standards.X509.verify_certificate_chain(certs,
context->trusted_issuers_cache,
context->require_trust);
context->require_trust,
([ "verifier_algorithms"
: context->verifier_algorithms]));
// This data isn't actually used internally.
session->cert_data = result;
......
......@@ -70,6 +70,22 @@ ProtocolVersion max_version = PROTOCOL_TLS_MAX;
//! protocol negotiation.
array(string(8bit)) advertised_protocols;
//! Mapping of supported verifier algorithms to hash implementation.
//!
//! @seealso
//! @[Standards.X509.get_algorithms()]
mapping(Standards.ASN1.Types.Identifier:Crypto.Hash) verifier_algorithms
= filter(Standards.X509.get_algorithms(),
lambda(object o) {
return !(<
#if constant(Crypto.MD2)
Crypto.MD2,
#endif
Crypto.MD5,
Crypto.SHA1
>)[o];
});
//! The maximum amount of data that is sent in each SSL packet by
//! @[File]. A value between 1 and @[Constants.PACKET_MAX_SIZE].
int packet_max_size = PACKET_MAX_SIZE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment