There was an error while loading. Please reload this page.
1 parent 0ac1d2f commit 2353bc6Copy full SHA for 2353bc6
1 file changed
tssh-pkcs11/src/pkcs11/mod.rs
@@ -668,17 +668,16 @@ pub unsafe extern "C" fn C_GetAttributeValue(
668
};
669
670
let modulus_bytes = match pub_key.key_data() {
671
- ssh_key::public::KeyData::Rsa(rsa_pub_key) => rsa_pub_key.n.as_bytes(),
+ ssh_key::public::KeyData::Rsa(rsa_pub_key) => {
672
+ rsa_pub_key.n.as_positive_bytes().unwrap()
673
+ } //Todo:
674
_ => {
675
error!("Expected RSA public key");
676
return CKR_GENERAL_ERROR;
677
}
678
679
680
let mut rsa_key = modulus_bytes;
- if modulus_bytes.first() == Some(&0x00) {
- rsa_key = &modulus_bytes[1..];
681
- }
682
683
if attr.pValue.is_null() {
684
debug!("CKA_MODULUS size request");
0 commit comments