Skip to content

Commit

Permalink
fix(dpp): add input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
lklimek committed Oct 2, 2024
1 parent 3454692 commit e03289d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions packages/rs-dpp/src/identity/identity_public_key/random.rs
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,14 @@ impl IdentityPublicKey {
"at least 2 keys must be created".to_string(),
));
}

if key_count > 16 {
return Err(ProtocolError::PublicKeyGenerationError(format!(
"too many keys requested: {}, max is 16",
key_count
)));
}

//create a master and a high level key
let mut main_keys = if key_count == 2 {
vec![
Expand Down

0 comments on commit e03289d

Please sign in to comment.