diff --git a/openpgp-card/src/apdu/command.rs b/openpgp-card/src/apdu/command.rs index 255bac5..44c9beb 100644 --- a/openpgp-card/src/apdu/command.rs +++ b/openpgp-card/src/apdu/command.rs @@ -17,11 +17,14 @@ pub(crate) struct Command { pub p1: u8, pub p2: u8, + // NOTE: data must be smaller than 64 kbyte pub data: Vec, } impl Command { pub fn new(cla: u8, ins: u8, p1: u8, p2: u8, data: Vec) -> Self { + assert!(data.len() < 0x10000, "'data' too big, must be <64 kbyte"); + Command { cla, ins,