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:
parent
3bc14e9d19
commit
fd9cd6eabd
2 changed files with 8 additions and 4 deletions
|
@ -94,16 +94,20 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||||
|
|
||||||
let res = oc_admin.set_name("Bar<<Foo")?;
|
let res = oc_admin.set_name("Bar<<Foo")?;
|
||||||
println!("set name {:x?}", res);
|
println!("set name {:x?}", res);
|
||||||
|
res.check_ok()?;
|
||||||
|
|
||||||
let res =
|
let res =
|
||||||
oc_admin.set_sex(openpgp_card::Sex::NotApplicable)?;
|
oc_admin.set_sex(openpgp_card::Sex::NotApplicable)?;
|
||||||
println!("set sex {:x?}", res);
|
println!("set sex {:x?}", res);
|
||||||
|
res.check_ok()?;
|
||||||
|
|
||||||
let res = oc_admin.set_lang("en")?;
|
let res = oc_admin.set_lang("en")?;
|
||||||
println!("set lang {:x?}", res);
|
println!("set lang {:x?}", res);
|
||||||
|
res.check_ok()?;
|
||||||
|
|
||||||
let res = oc_admin.set_url("https://keys.openpgp.org")?;
|
let res = oc_admin.set_url("https://keys.openpgp.org")?;
|
||||||
println!("set url {:x?}", res);
|
println!("set url {:x?}", res);
|
||||||
|
res.check_ok()?;
|
||||||
|
|
||||||
let cert = Cert::from_file(TEST_KEY_PATH)?;
|
let cert = Cert::from_file(TEST_KEY_PATH)?;
|
||||||
|
|
||||||
|
|
|
@ -784,7 +784,7 @@ impl CardAdmin {
|
||||||
};
|
};
|
||||||
|
|
||||||
let put_name = commands::put_name(name.as_bytes().to_vec());
|
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> {
|
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());
|
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> {
|
pub fn set_sex(&self, sex: Sex) -> Result<Response, OpenpgpCardError> {
|
||||||
let put_sex = commands::put_sex(sex.as_u8());
|
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> {
|
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 {
|
if url.len() < ec.max_len_special_do as usize {
|
||||||
let put_url = commands::put_url(url.as_bytes().to_vec());
|
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 {
|
} else {
|
||||||
Err(anyhow!("URL too long").into())
|
Err(anyhow!("URL too long").into())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue