diff options
-rw-r--r-- | openpgp/examples/statistics.rs | 4 | ||||
-rw-r--r-- | openpgp/src/constants.rs | 4 | ||||
-rw-r--r-- | openpgp/src/conversions.rs | 8 | ||||
-rw-r--r-- | openpgp/src/crypto/hash.rs | 4 | ||||
-rw-r--r-- | openpgp/src/packet/one_pass_sig.rs | 18 | ||||
-rw-r--r-- | openpgp/src/packet/signature/mod.rs | 86 | ||||
-rw-r--r-- | openpgp/src/parse/parse.rs | 16 | ||||
-rw-r--r-- | openpgp/src/serialize/mod.rs | 4 | ||||
-rw-r--r-- | openpgp/src/serialize/tpk.rs | 4 | ||||
-rw-r--r-- | openpgp/src/tpk/bindings.rs | 6 | ||||
-rw-r--r-- | openpgp/src/tpk/builder.rs | 6 | ||||
-rw-r--r-- | openpgp/src/tpk/mod.rs | 42 | ||||
-rw-r--r-- | openpgp/src/tsk.rs | 2 | ||||
-rw-r--r-- | tool/src/commands/dump.rs | 4 | ||||
-rw-r--r-- | tool/src/commands/inspect.rs | 2 | ||||
-rw-r--r-- | tool/tests/sq-sign.rs | 72 |
16 files changed, 141 insertions, 141 deletions
diff --git a/openpgp/examples/statistics.rs b/openpgp/examples/statistics.rs index 9bfdd94e..bd26cc40 100644 --- a/openpgp/examples/statistics.rs +++ b/openpgp/examples/statistics.rs @@ -89,8 +89,8 @@ fn main() { }, Packet::Signature(ref sig) => { - sigs_count[u8::from(sig.sigtype()) as usize] += 1; - tpk.sigs[u8::from(sig.sigtype()) as usize] += 1; + sigs_count[u8::from(sig.typ()) as usize] += 1; + tpk.sigs[u8::from(sig.typ()) as usize] += 1; for (_offset, len, sub) in sig.hashed_area().iter() .chain(sig.unhashed_area().iter()) diff --git a/openpgp/src/constants.rs b/openpgp/src/constants.rs index b3e3c265..a7a0501c 100644 --- a/openpgp/src/constants.rs +++ b/openpgp/src/constants.rs @@ -1160,14 +1160,14 @@ mod tests { quickcheck! { - fn sigtype_roundtrip(t: SignatureType) -> bool { + fn signature_type_roundtrip(t: SignatureType) -> bool { let val: u8 = t.clone().into(); t == SignatureType::from(val) } } quickcheck! { - fn sigtype_display(t: SignatureType) -> bool { + fn signature_type_display(t: SignatureType) -> bool { let s = format!("{}", t); !s.is_empty() } diff --git a/openpgp/src/conversions.rs b/openpgp/src/conversions.rs index 5c76fb1d..2889a647 100644 --- a/openpgp/src/conversions.rs +++ b/openpgp/src/conversions.rs @@ -101,14 +101,14 @@ pub mod hex { /// let mut dumper = hex::Dumper::new(Vec::new(), ""); /// dumper.write(&[0x89, 0x01, 0x33], "frame").unwrap(); /// dumper.write(&[0x04], "version").unwrap(); - /// dumper.write(&[0x00], "sigtype").unwrap(); + /// dumper.write(&[0x00], "type").unwrap(); /// /// let buf = dumper.into_inner(); /// assert_eq!( /// ::std::str::from_utf8(&buf[..]).unwrap(), /// "00000000 89 01 33 frame\n\ /// 00000003 04 version\n\ - /// 00000004 00 sigtype\n\ + /// 00000004 00 type\n\ /// "); /// ``` pub struct Dumper<W: io::Write> { @@ -403,7 +403,7 @@ mod test { let mut dumper = Dumper::new(Vec::new(), ""); dumper.write(&[0x89, 0x01, 0x33], "frame").unwrap(); dumper.write(&[0x04], "version").unwrap(); - dumper.write(&[0x00], "sigtype").unwrap(); + dumper.write(&[0x00], "type").unwrap(); let buf = dumper.into_inner(); assert_eq!( ::std::str::from_utf8(&buf[..]).unwrap(), @@ -412,7 +412,7 @@ mod test { 00000003 04 \ version\n\ 00000004 00 \ - sigtype\n\ + type\n\ "); } diff --git a/openpgp/src/crypto/hash.rs b/openpgp/src/crypto/hash.rs index 85ffd51f..78b13d8e 100644 --- a/openpgp/src/crypto/hash.rs +++ b/openpgp/src/crypto/hash.rs @@ -280,7 +280,7 @@ impl Hash for signature::Builder { // A version 4 signature packet is laid out as follows: // // version - 1 byte \ - // sigtype - 1 byte \ + // type - 1 byte \ // pk_algo - 1 byte \ // hash_algo - 1 byte Included in the hash // hashed_area_len - 2 bytes (big endian)/ @@ -291,7 +291,7 @@ impl Hash for signature::Builder { // Version. header[0] = 4; - header[1] = self.sigtype().into(); + header[1] = self.typ().into(); header[2] = self.pk_algo().into(); header[3] = self.hash_algo().into(); diff --git a/openpgp/src/packet/one_pass_sig.rs b/openpgp/src/packet/one_pass_sig.rs index 58230ed9..5826eefd 100644 --- a/openpgp/src/packet/one_pass_sig.rs +++ b/openpgp/src/packet/one_pass_sig.rs @@ -28,7 +28,7 @@ pub struct OnePassSig3 { /// CTB packet header fields. pub(crate) common: packet::Common, /// Type of the signature. - sigtype: SignatureType, + typ: SignatureType, /// Hash algorithm used to compute the signature. hash_algo: HashAlgorithm, /// Public key algorithm of this signature. @@ -43,7 +43,7 @@ pub struct OnePassSig3 { impl fmt::Debug for OnePassSig3 { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("OnePassSig3") - .field("sigtype", &self.sigtype) + .field("typ", &self.typ) .field("hash_algo", &self.hash_algo) .field("pk_algo", &self.pk_algo) .field("issuer", &self.issuer) @@ -67,10 +67,10 @@ impl PartialEq for OnePassSig3 { impl OnePassSig3 { /// Returns a new `Signature` packet. - pub fn new(sigtype: SignatureType) -> Self { + pub fn new(typ: SignatureType) -> Self { OnePassSig3 { common: Default::default(), - sigtype: sigtype, + typ: typ, hash_algo: HashAlgorithm::Unknown(0), pk_algo: PublicKeyAlgorithm::Unknown(0), issuer: KeyID::new(0), @@ -79,13 +79,13 @@ impl OnePassSig3 { } /// Gets the signature type. - pub fn sigtype(&self) -> SignatureType { - self.sigtype + pub fn typ(&self) -> SignatureType { + self.typ } /// Sets the signature type. - pub fn set_sigtype(&mut self, t: SignatureType) -> SignatureType { - ::std::mem::replace(&mut self.sigtype, t) + pub fn set_type(&mut self, t: SignatureType) -> SignatureType { + ::std::mem::replace(&mut self.typ, t) } /// Gets the public key algorithm. @@ -162,7 +162,7 @@ impl<'a> From<&'a Signature> for Result<OnePassSig3> { Ok(OnePassSig3 { common: Default::default(), - sigtype: s.sigtype(), + typ: s.typ(), hash_algo: s.hash_algo(), pk_algo: s.pk_algo(), issuer: issuer, diff --git a/openpgp/src/packet/signature/mod.rs b/openpgp/src/packet/signature/mod.rs index b32d47ab..813ae7e3 100644 --- a/openpgp/src/packet/signature/mod.rs +++ b/openpgp/src/packet/signature/mod.rs @@ -39,7 +39,7 @@ pub struct Builder { /// Version of the signature packet. Must be 4. version: u8, /// Type of signature. - sigtype: SignatureType, + typ: SignatureType, /// Pub(Crate)lic-key algorithm used for this signature. pk_algo: PublicKeyAlgorithm, /// Hash algorithm used to compute the signature. @@ -52,10 +52,10 @@ pub struct Builder { impl Builder { /// Returns a new `Builder` object. - pub fn new(sigtype: SignatureType) -> Self { + pub fn new(typ: SignatureType) -> Self { Builder { version: 4, - sigtype: sigtype, + typ: typ, pk_algo: PublicKeyAlgorithm::Unknown(0), hash_algo: HashAlgorithm::Unknown(0), hashed_area: SubpacketArea::empty(), @@ -69,13 +69,13 @@ impl Builder { } /// Gets the signature type. - pub fn sigtype(&self) -> SignatureType { - self.sigtype + pub fn typ(&self) -> SignatureType { + self.typ } /// Sets the signature type. - pub fn set_sigtype(mut self, t: SignatureType) -> Self { - self.sigtype = t; + pub fn set_type(mut self, t: SignatureType) -> Self { + self.typ = t; self } @@ -316,7 +316,7 @@ impl fmt::Debug for Signature4 { f.debug_struct("Signature4") .field("version", &self.version()) - .field("sigtype", &self.sigtype()) + .field("typ", &self.typ()) .field("issuer", &issuer) .field("pk_algo", &self.pk_algo()) .field("hash_algo", &self.hash_algo()) @@ -350,7 +350,7 @@ impl PartialEq for Signature4 { /// signatures using this predicate. fn eq(&self, other: &Signature4) -> bool { self.fields.version == other.fields.version - && self.fields.sigtype == other.fields.sigtype + && self.fields.typ == other.fields.typ && self.fields.pk_algo == other.fields.pk_algo && self.fields.hash_algo == other.fields.hash_algo && self.fields.hashed_area == other.fields.hashed_area @@ -362,7 +362,7 @@ impl std::hash::Hash for Signature4 { fn hash<H: std::hash::Hasher>(&self, state: &mut H) { use std::hash::Hash as StdHash; self.fields.version.hash(state); - self.fields.sigtype.hash(state); + self.fields.typ.hash(state); self.fields.pk_algo.hash(state); self.fields.hash_algo.hash(state); self.fields.hashed_area.hash(state); @@ -377,7 +377,7 @@ impl Signature4 { /// interface. /// /// [`Builder`]: struct.Builder.html - pub fn new(sigtype: SignatureType, pk_algo: PublicKeyAlgorithm, + pub fn new(typ: SignatureType, pk_algo: PublicKeyAlgorithm, hash_algo: HashAlgorithm, hashed_area: SubpacketArea, unhashed_area: SubpacketArea, hash_prefix: [u8; 2], @@ -386,7 +386,7 @@ impl Signature4 { common: Default::default(), fields: Builder { version: 4, - sigtype: sigtype.into(), + typ: typ, pk_algo: pk_algo.into(), hash_algo: hash_algo, hashed_area: hashed_area, @@ -637,10 +637,10 @@ impl Signature4 { /// subkey binding signature (if appropriate), has the signing /// capability, etc. pub fn verify(&self, key: &Key) -> Result<bool> { - if !(self.sigtype() == SignatureType::Binary - || self.sigtype() == SignatureType::Text - || self.sigtype() == SignatureType::Standalone) { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if !(self.typ() == SignatureType::Binary + || self.typ() == SignatureType::Text + || self.typ() == SignatureType::Standalone) { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } if let Some((hash_algo, ref hash)) = self.computed_hash { @@ -670,8 +670,8 @@ impl Signature4 { pub fn verify_primary_key_binding(&self, signer: &Key, pk: &Key) -> Result<bool> { - if self.sigtype() != SignatureType::DirectKey { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::DirectKey { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::primary_key_binding_hash(self, pk)?; @@ -698,8 +698,8 @@ impl Signature4 { pub fn verify_primary_key_revocation(&self, signer: &Key, pk: &Key) -> Result<bool> { - if self.sigtype() != SignatureType::KeyRevocation { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::KeyRevocation { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::primary_key_binding_hash(self, pk)?; @@ -731,8 +731,8 @@ impl Signature4 { pub fn verify_subkey_binding(&self, signer: &Key, pk: &Key, subkey: &Key) -> Result<bool> { - if self.sigtype() != SignatureType::SubkeyBinding { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::SubkeyBinding { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::subkey_binding_hash(self, pk, subkey)?; @@ -752,8 +752,8 @@ impl Signature4 { if let Some(Packet::Signature(super::Signature::V4(backsig))) = self.embedded_signature() { - if backsig.sigtype() != SignatureType::PrimaryKeyBinding { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if backsig.typ() != SignatureType::PrimaryKeyBinding { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } else { // We can't use backsig.verify_subkey_binding. let hash = Signature::subkey_binding_hash(&backsig, pk, &subkey)?; @@ -807,8 +807,8 @@ impl Signature4 { subkey: &Key) -> Result<bool> { - if self.sigtype() != SignatureType::SubkeyRevocation { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::SubkeyRevocation { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::subkey_binding_hash(self, pk, subkey)?; @@ -836,11 +836,11 @@ impl Signature4 { pk: &Key, userid: &UserID) -> Result<bool> { - if !(self.sigtype() == SignatureType::GenericCertificate - || self.sigtype() == SignatureType::PersonaCertificate - || self.sigtype() == SignatureType::CasualCertificate - || self.sigtype() == SignatureType::PositiveCertificate) { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if !(self.typ() == SignatureType::GenericCertificate + || self.typ() == SignatureType::PersonaCertificate + || self.typ() == SignatureType::CasualCertificate + || self.typ() == SignatureType::PositiveCertificate) { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::userid_binding_hash(self, pk, userid)?; @@ -868,8 +868,8 @@ impl Signature4 { pk: &Key, userid: &UserID) -> Result<bool> { - if self.sigtype() != SignatureType::CertificateRevocation { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::CertificateRevocation { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::userid_binding_hash(self, pk, userid)?; @@ -897,11 +897,11 @@ impl Signature4 { pk: &Key, ua: &UserAttribute) -> Result<bool> { - if !(self.sigtype() == SignatureType::GenericCertificate - || self.sigtype() == SignatureType::PersonaCertificate - || self.sigtype() == SignatureType::CasualCertificate - || self.sigtype() == SignatureType::PositiveCertificate) { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if !(self.typ() == SignatureType::GenericCertificate + || self.typ() == SignatureType::PersonaCertificate + || self.typ() == SignatureType::CasualCertificate + || self.typ() == SignatureType::PositiveCertificate) { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::user_attribute_binding_hash(self, pk, ua)?; @@ -929,8 +929,8 @@ impl Signature4 { pk: &Key, ua: &UserAttribute) -> Result<bool> { - if self.sigtype() != SignatureType::CertificateRevocation { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::CertificateRevocation { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } let hash = Signature::user_attribute_binding_hash(self, pk, ua)?; @@ -957,9 +957,9 @@ impl Signature4 { pub fn verify_message(&self, signer: &Key, msg: &[u8]) -> Result<bool> { - if self.sigtype() != SignatureType::Binary && - self.sigtype() != SignatureType::Text { - return Err(Error::UnsupportedSignatureType(self.sigtype()).into()); + if self.typ() != SignatureType::Binary && + self.typ() != SignatureType::Text { + return Err(Error::UnsupportedSignatureType(self.typ()).into()); } // Compute the digest. diff --git a/openpgp/src/parse/parse.rs b/openpgp/src/parse/parse.rs index b0c77b2d..c85852b4 100644 --- a/openpgp/src/parse/parse.rs +++ b/openpgp/src/parse/parse.rs @@ -879,7 +879,7 @@ impl Signature4 { make_php_try!(php); - let sigtype = php_try!(php.parse_u8("sigtype")); + let typ = php_try!(php.parse_u8("type")); let pk_algo: PublicKeyAlgorithm = php_try!(php.parse_u8("pk_algo")).into(); let hash_algo = php_try!(php.parse_u8("hash_algo")); let hashed_area_len = php_try!(php.parse_be_u16("hashed_area_len")); @@ -900,7 +900,7 @@ impl Signature4 { let hash_algo = hash_algo.into(); let mut pp = php.ok(Packet::Signature(Signature4::new( - sigtype.into(), pk_algo.into(), hash_algo, + typ.into(), pk_algo.into(), hash_algo, SubpacketArea::new(hashed_area), SubpacketArea::new(unhashed_area), [hash_prefix1, hash_prefix2], @@ -994,12 +994,12 @@ impl Signature4 { // Assume unknown == bad. let version = data[0]; - let sigtype : SignatureType = data[1].into(); + let typ : SignatureType = data[1].into(); let pk_algo : PublicKeyAlgorithm = data[2].into(); let hash_algo : HashAlgorithm = data[3].into(); if version == 4 - && !destructures_to!(SignatureType::Unknown(_) = sigtype) + && !destructures_to!(SignatureType::Unknown(_) = typ) && !destructures_to!(PublicKeyAlgorithm::Unknown(_) = pk_algo) && !destructures_to!(HashAlgorithm::Unknown(_) = hash_algo) { @@ -1022,7 +1022,7 @@ fn signature_parser_test () { assert_eq!(pp.header.length, BodyLength::Full(307)); if let Packet::Signature(ref p) = pp.packet { assert_eq!(p.version(), 4); - assert_eq!(p.sigtype(), SignatureType::Binary); + assert_eq!(p.typ(), SignatureType::Binary); assert_eq!(p.pk_algo(), PublicKeyAlgorithm::RSAEncryptSign); assert_eq!(p.hash_algo(), HashAlgorithm::SHA512); assert_eq!(p.hashed_area().data.len(), 29); @@ -1062,7 +1062,7 @@ impl OnePassSig3 { return php.fail("unknown version"); } - let sigtype = php_try!(php.parse_u8("sigtype")); + let typ = php_try!(php.parse_u8("type")); let hash_algo = php_try!(php.parse_u8("hash_algo")); let pk_algo = php_try!(php.parse_u8("pk_algo")); let mut issuer = [0u8; 8]; @@ -1070,7 +1070,7 @@ impl OnePassSig3 { let last = php_try!(php.parse_u8("last")); let hash_algo = hash_algo.into(); - let mut sig = OnePassSig3::new(sigtype.into()); + let mut sig = OnePassSig3::new(typ.into()); sig.set_hash_algo(hash_algo); sig.set_pk_algo(pk_algo.into()); sig.set_issuer(KeyID::from_bytes(&issuer)); @@ -1202,7 +1202,7 @@ fn one_pass_sig_parser_test () { if let &Packet::OnePassSig(ref p) = p { assert_eq!(p.version(), 3); - assert_eq!(p.sigtype(), SignatureType::Binary); + assert_eq!(p.typ(), SignatureType::Binary); assert_eq!(p.hash_algo(), HashAlgorithm::SHA512); assert_eq!(p.pk_algo(), PublicKeyAlgorithm::RSAEncryptSign); assert_eq!(p.issuer().to_hex(), "7223B56678E02528"); diff --git a/openpgp/src/serialize/mod.rs b/openpgp/src/serialize/mod.rs index 3589dbf9..aba1fd00 100644 --- a/openpgp/src/serialize/mod.rs +++ b/openpgp/src/serialize/mod.rs @@ -1168,7 +1168,7 @@ impl Serialize for Signature4 { fn serialize(&self, o: &mut dyn std::io::Write) -> Result<()> { assert_eq!(self.version(), 4); write_byte(o, self.version())?; - write_byte(o, self.sigtype().into())?; + write_byte(o, self.typ().into())?; write_byte(o, self.pk_algo().into())?; write_byte(o, self.hash_algo().into())?; @@ -1272,7 +1272,7 @@ impl SerializeInto for OnePassSig { impl Serialize for OnePassSig3 { fn serialize(&self, o: &mut dyn std::io::Write) -> Result<()> { write_byte(o, 3)?; // Version. - write_byte(o, self.sigtype().into())?; + write_byte(o, self.typ().into())?; write_byte(o, self.hash_algo().into())?; write_byte(o, self.pk_algo().into())?; o.write_all(self.issuer().as_slice())?; diff --git a/openpgp/src/serialize/tpk.rs b/openpgp/src/serialize/tpk.rs index 35d0775b..6afbfa3a 100644 --- a/openpgp/src/serialize/tpk.rs +++ b/openpgp/src/serialize/tpk.rs @@ -697,7 +697,7 @@ mod test { &mut keypair, &tpk, signature::Builder::from( tpk.primary_key_signature().unwrap().clone()) - .set_sigtype(SignatureType::PositiveCertificate) + .set_type(SignatureType::PositiveCertificate) .set_exportable_certification(false).unwrap(), None, None).unwrap(); @@ -708,7 +708,7 @@ mod test { &mut keypair, &tpk, signature::Builder::from( tpk.primary_key_signature().unwrap().clone()) - .set_sigtype(SignatureType::PositiveCertificate) + .set_type(SignatureType::PositiveCertificate) .set_exportable_certification(false).unwrap(), None, None).unwrap(); diff --git a/openpgp/src/tpk/bindings.rs b/openpgp/src/tpk/bindings.rs index a9d56601..81cd3b7c 100644 --- a/openpgp/src/tpk/bindings.rs +++ b/openpgp/src/tpk/bindings.rs @@ -95,7 +95,7 @@ impl Key { /// .revoke(&mut keypair, &tpk, /// ReasonForRevocation::KeyRetired, /// b"Smells funny.", None, None)?; - /// assert_eq!(revocation.sigtype(), SignatureType::SubkeyRevocation); + /// assert_eq!(revocation.typ(), SignatureType::SubkeyRevocation); /// /// // Now merge the revocation signature into the TPK. /// let tpk = tpk.merge_packets(vec![revocation.clone().into()])?; @@ -289,7 +289,7 @@ impl UserID { /// .revoke(&mut keypair, &tpk, /// ReasonForRevocation::UIDRetired, /// b"Left example.org.", None, None)?; - /// assert_eq!(revocation.sigtype(), SignatureType::CertificateRevocation); + /// assert_eq!(revocation.typ(), SignatureType::CertificateRevocation); /// /// // Now merge the revocation signature into the TPK. /// let tpk = tpk.merge_packets(vec![revocation.clone().into()])?; @@ -498,7 +498,7 @@ impl UserAttribute { /// .revoke(&mut keypair, &tpk, /// ReasonForRevocation::UIDRetired, /// b"I look different now.", None, None)?; - /// assert_eq!(revocation.sigtype(), SignatureType::CertificateRevocation); + /// assert_eq!(revocation.typ(), SignatureType::CertificateRevocation); /// /// // Now merge the revocation signature into the TPK. /// let tpk = tpk.merge_packets(vec![revocation.clone().into()])?; diff --git a/openpgp/src/tpk/builder.rs b/openpgp/src/tpk/builder.rs index 4a30a5ae..beae342a 100644 --- a/openpgp/src/tpk/builder.rs +++ b/openpgp/src/tpk/builder.rs @@ -303,7 +303,7 @@ impl TPKBuilder { // Sign UserIDs. for uid in self.userids.into_iter() { let builder = signature::Builder::from(sig.clone()) - .set_sigtype(SignatureType::PositiveCertificate); + .set_type(SignatureType::PositiveCertificate); let signature = uid.bind(&mut signer, &tpk, builder, None, None)?; tpk = tpk.merge_packets(vec![uid.into(), signature.into()])?; } @@ -311,7 +311,7 @@ impl TPKBuilder { // Sign UserAttributes. for ua in self.user_attributes.into_iter() { let builder = signature::Builder::from(sig.clone()) - .set_sigtype(SignatureType::PositiveCertificate); + .set_type(SignatureType::PositiveCertificate); let signature = ua.bind(&mut signer, &tpk, builder, None, None)?; tpk = tpk.merge_packets(vec![ua.into(), signature.into()])?; } @@ -436,7 +436,7 @@ mod tests { .generate().unwrap(); |