Use the first matching sigalg
Previously we iterated thru the entire list. Short circuit and choose
the first match from the preference list.
@@ -68,6 +68,7 @@ int s2n_set_signature_hash_pair_from_preference_list(struct s2n_connection *conn
if (s2n_sig_hash_alg_pairs_get(sig_hash_algs, sig_alg_chosen, s2n_preferred_hashes[i]) == 1) {
/* Just set hash_alg_chosen because sig_alg_chosen was set above based on cert type */
hash_alg_chosen = s2n_hash_tls_to_alg[s2n_preferred_hashes[i]];
+ break;
}
}
