Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

Commit

Permalink
add assert for ensuring ESDSA signature length is even.
Browse files Browse the repository at this point in the history
fix #148

Signed-off-by: Yang, Longlong <[email protected]>
  • Loading branch information
longlongyang authored and jyao1 committed Nov 16, 2023
1 parent 0f17765 commit de6b93f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions spdmlib/src/crypto/spdm_ring/asym_verify_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ fn asym_verify(
// add ASN.1 for the ECDSA binary signature
fn ecc_signature_bin_to_der(signature: &[u8], der_signature: &mut [u8]) -> SpdmResult<usize> {
let sign_size = signature.len();
assert_eq!(sign_size % 2, 0);
let half_size = sign_size / 2;

let mut r_index = half_size;
Expand Down

0 comments on commit de6b93f

Please sign in to comment.