Commit 06f1e959 authored by Alexander Færøy's avatar Alexander Færøy 🍍 Committed by Nick Mathewson
Browse files

Add constness to length variables in `tor_tls_cert_matches_key`.

We add constness to `peer_info_orig_len` and `cert_info_orig_len` in
`tor_tls_cert_matches_key` to ensure that we don't accidentally alter
the variables.

This patch is part of the fix for TROVE-2020-001.

parent b46984e9
......@@ -739,8 +739,8 @@ tor_tls_cert_matches_key,(const tor_tls_t *tls,
* in seckey.c in the NSS source tree. This function also does the conversion
* between bits and bytes.
unsigned int peer_info_orig_len = peer_info->subjectPublicKey.len;
unsigned int cert_info_orig_len = cert_info->subjectPublicKey.len;
const unsigned int peer_info_orig_len = peer_info->subjectPublicKey.len;
const unsigned int cert_info_orig_len = cert_info->subjectPublicKey.len;
peer_info->subjectPublicKey.len = (peer_info_orig_len >> 3);
cert_info->subjectPublicKey.len = (cert_info_orig_len >> 3);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment