Skip to content

Commit

Permalink
More descriptive length encoding function names
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Jan 3, 2024
1 parent 2c5a320 commit cb775c8
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 96 deletions.
6 changes: 3 additions & 3 deletions src/tls13crypto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use rand::{CryptoRng, RngCore};
// use tracing::{event, Level};

use crate::tls13utils::{
check_lbytes2, check_mem, eq, tlserr, Bytes, Error, TLSError, CRYPTO_ERROR, INVALID_SIGNATURE,
UNSUPPORTED_ALGORITHM,
check_mem, eq, length_u16_encoded, tlserr, Bytes, Error, TLSError, CRYPTO_ERROR,
INVALID_SIGNATURE, UNSUPPORTED_ALGORITHM,
};

pub(crate) type Random = Bytes; //was [U8;32]
Expand Down Expand Up @@ -692,7 +692,7 @@ impl Algorithms {

/// Check the ciphersuite in `bytes` against this ciphersuite.
pub(crate) fn check(&self, bytes: &Bytes) -> Result<usize, TLSError> {
let len = check_lbytes2(bytes)?;
let len = length_u16_encoded(bytes)?;
let cs = self.ciphersuite()?;
let csl = bytes.slice_range(2..2 + len);
check_mem(&cs, &csl)?;
Expand Down
Loading

0 comments on commit cb775c8

Please sign in to comment.