Change set* commands to leave out 'Le', because no response data is expected.

(The Floss-Card 3.4 rejects set* commands with "expected" response data)
This commit is contained in:
Heiko Schaefer 2021-07-04 01:03:09 +02:00
parent 3bc14e9d19
commit fd9cd6eabd
2 changed files with 8 additions and 4 deletions

View file

@ -94,16 +94,20 @@ fn main() -> Result<(), Box<dyn Error>> {
let res = oc_admin.set_name("Bar<<Foo")?;
println!("set name {:x?}", res);
res.check_ok()?;
let res =
oc_admin.set_sex(openpgp_card::Sex::NotApplicable)?;
println!("set sex {:x?}", res);
res.check_ok()?;
let res = oc_admin.set_lang("en")?;
println!("set lang {:x?}", res);
res.check_ok()?;
let res = oc_admin.set_url("https://keys.openpgp.org")?;
println!("set url {:x?}", res);
res.check_ok()?;
let cert = Cert::from_file(TEST_KEY_PATH)?;

View file

@ -784,7 +784,7 @@ impl CardAdmin {
};
let put_name = commands::put_name(name.as_bytes().to_vec());
apdu::send_command(self.card(), put_name, Le::Short, Some(self))
apdu::send_command(self.card(), put_name, Le::None, Some(self))
}
pub fn set_lang(&self, lang: &str) -> Result<Response, OpenpgpCardError> {
@ -793,12 +793,12 @@ impl CardAdmin {
}
let put_lang = commands::put_lang(lang.as_bytes().to_vec());
apdu::send_command(self.card(), put_lang, Le::Short, Some(self))
apdu::send_command(self.card(), put_lang, Le::None, Some(self))
}
pub fn set_sex(&self, sex: Sex) -> Result<Response, OpenpgpCardError> {
let put_sex = commands::put_sex(sex.as_u8());
apdu::send_command(self.card(), put_sex, Le::Short, Some(self))
apdu::send_command(self.card(), put_sex, Le::None, Some(self))
}
pub fn set_url(&self, url: &str) -> Result<Response, OpenpgpCardError> {
@ -811,7 +811,7 @@ impl CardAdmin {
if url.len() < ec.max_len_special_do as usize {
let put_url = commands::put_url(url.as_bytes().to_vec());
apdu::send_command(self.card(), put_url, Le::Short, Some(self))
apdu::send_command(self.card(), put_url, Le::None, Some(self))
} else {
Err(anyhow!("URL too long").into())
}