Skip to content

Commit

Permalink
Remove null byte truncation in BER
Browse files Browse the repository at this point in the history
  • Loading branch information
XAMPPRocky committed Jul 26, 2023
1 parent 38f8001 commit 4538451
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/ber/enc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,6 @@ impl crate::Encoder for Encoder {
let bit_length = value.len();
let bytes = value.clone().into_vec();
let mut deque = VecDeque::from(bytes);
while deque.back().map_or(false, |i| *i == 0) {
deque.pop_back();
}

deque.push_front((deque.len() * 8).saturating_sub(bit_length) as u8);
self.encode_string(tag, Tag::BIT_STRING, &Vec::from(deque))
Expand Down

0 comments on commit 4538451

Please sign in to comment.