diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2020-03-06 12:39:07 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2020-03-09 18:09:19 +0100 |
commit | 58d662c6d37dd1b0dccd4d0ce30290b8ede408e9 (patch) | |
tree | ab850355c6bcded1cba184db98263908736f1fc4 | |
parent | f484efee5bf61f7ce90d5383ba2f589fe03ae518 (diff) |
openpgp: Update nettle to 7.0.0.
-rw-r--r-- | Cargo.lock | 8 | ||||
-rw-r--r-- | openpgp/Cargo.toml | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/asymmetric.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/ecdh.rs | 2 | ||||
-rw-r--r-- | openpgp/src/crypto/hash.rs | 14 | ||||
-rw-r--r-- | openpgp/src/crypto/mod.rs | 2 | ||||
-rw-r--r-- | openpgp/src/packet/key/mod.rs | 4 |
7 files changed, 17 insertions, 17 deletions
@@ -1012,13 +1012,13 @@ dependencies = [ [[package]] name = "nettle" -version = "6.0.1" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "failure 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", "nettle-sys 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "thiserror 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1662,7 +1662,7 @@ dependencies = [ "lalrpop-util 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "memsec 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", - "nettle 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "nettle 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "quickcheck 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2376,7 +2376,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" -"checksum nettle 6.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6fd54cf3d08c0437fa65b09721983a87c447da440fb02b497292bdcab1632a4f" +"checksum nettle 7.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b1afae85450b829ad720f2827e3b07d78e06b5521cfe5ed72808a9f593e7cdd8" "checksum nettle-src 3.5.1-2 (registry+https://github.com/rust-lang/crates.io-index)" = "fad3c0d4be23880e92170c10f009f1d4b0dd842a523dd8b35c89738fd3b640c8" "checksum nettle-sys 2.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b8629333ff5f3b74d251dae253e383cda9242410fac4244a4fe855469be101fb" "checksum new_debug_unreachable 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" diff --git a/openpgp/Cargo.toml b/openpgp/Cargo.toml index 1e50e376..e3a22bab 100644 --- a/openpgp/Cargo.toml +++ b/openpgp/Cargo.toml @@ -31,7 +31,7 @@ idna = "0.2" lalrpop-util = "0.17" lazy_static = "1.3" memsec = "0.5.6" -nettle = "6.0.1" +nettle = "7" quickcheck = { version = "0.9", default-features = false } rand = { version = "0.7", default-features = false } regex = "1" diff --git a/openpgp/src/crypto/asymmetric.rs b/openpgp/src/crypto/asymmetric.rs index aedf1ab8..5948f71c 100644 --- a/openpgp/src/crypto/asymmetric.rs +++ b/openpgp/src/crypto/asymmetric.rs @@ -1,6 +1,6 @@ //! Asymmetric crypt operations. -use nettle::{dsa, ecc, ecdsa, ed25519, rsa, Yarrow}; +use nettle::{dsa, ecc, ecdsa, ed25519, rsa, random::Yarrow}; use crate::packet::{self, key, Key}; use crate::crypto::SessionKey; diff --git a/openpgp/src/crypto/ecdh.rs b/openpgp/src/crypto/ecdh.rs index c50a60d5..b191d556 100644 --- a/openpgp/src/crypto/ecdh.rs +++ b/openpgp/src/crypto/ecdh.rs @@ -20,7 +20,7 @@ use crate::utils::{ use crate::crypto::SessionKey; use crate::crypto::mem::Protected; use crate::crypto::mpis::{MPI, PublicKey, SecretKeyMaterial, Ciphertext}; -use nettle::{cipher, curve25519, mode, Mode, ecc, ecdh, Yarrow}; +use nettle::{cipher, curve25519, mode, mode::Mode, ecc, ecdh, random::Yarrow}; /// Wraps a session key using Elliptic Curve Diffie-Hellman. #[allow(non_snake_case)] diff --git a/openpgp/src/crypto/hash.rs b/openpgp/src/crypto/hash.rs index 47220da8..87d89b34 100644 --- a/openpgp/src/crypto/hash.rs +++ b/openpgp/src/crypto/hash.rs @@ -25,7 +25,7 @@ const DUMP_HASHED_VALUES: Option<&str> = None; #[derive(Clone)] pub struct Context { algo: HashAlgorithm, - ctx: Box<dyn nettle::Hash>, + ctx: Box<dyn nettle::hash::Hash>, } impl Context { @@ -101,7 +101,7 @@ impl HashAlgorithm { Ripemd160, }; - let c: Result<Box<dyn nettle::Hash>> = match self { + let c: Result<Box<dyn nettle::hash::Hash>> = match self { HashAlgorithm::SHA1 => Ok(Box::new(Sha1::default())), HashAlgorithm::SHA224 => Ok(Box::new(Sha224::default())), HashAlgorithm::SHA256 => Ok(Box::new(Sha256::default())), @@ -115,7 +115,7 @@ impl HashAlgorithm { }; if let Some(prefix) = DUMP_HASHED_VALUES { - c.map(|c: Box<dyn nettle::Hash>| { + c.map(|c: Box<dyn nettle::hash::Hash>| { Context { algo: self, ctx: Box::new(HashDumper::new(c, prefix)), @@ -146,14 +146,14 @@ impl HashAlgorithm { } struct HashDumper { - h: Box<dyn nettle::Hash>, + h: Box<dyn nettle::hash::Hash>, sink: File, filename: String, written: usize, } impl HashDumper { - fn new(h: Box<dyn nettle::Hash>, prefix: &str) -> Self { + fn new(h: Box<dyn nettle::hash::Hash>, prefix: &str) -> Self { let mut n = 0; let mut filename; let sink = loop { @@ -182,7 +182,7 @@ impl Drop for HashDumper { } } -impl nettle::Hash for HashDumper { +impl nettle::hash::Hash for HashDumper { fn digest_size(&self) -> usize { self.h.digest_size() } @@ -194,7 +194,7 @@ impl nettle::Hash for HashDumper { fn digest(&mut self, digest: &mut [u8]) { self.h.digest(digest); } - fn box_clone(&self) -> Box<dyn nettle::Hash> { + fn box_clone(&self) -> Box<dyn nettle::hash::Hash> { Box::new(Self::new(self.h.box_clone(), &DUMP_HASHED_VALUES.unwrap())) } } diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs index c93b3625..d1b9f540 100644 --- a/openpgp/src/crypto/mod.rs +++ b/openpgp/src/crypto/mod.rs @@ -4,7 +4,7 @@ use std::io::Read; use std::ops::{Deref, DerefMut}; use std::fmt; -use nettle::{Random, Yarrow}; +use nettle::random::{Random, Yarrow}; use crate::types::HashAlgorithm; use crate::Result; diff --git a/openpgp/src/packet/key/mod.rs b/openpgp/src/packet/key/mod.rs index cd184b64..1fbca529 100644 --- a/openpgp/src/packet/key/mod.rs +++ b/openpgp/src/packet/key/mod.rs @@ -1100,7 +1100,7 @@ impl<R> Key4<SecretParts, R> /// Generates a new RSA key with a public modulos of size `bits`. pub fn generate_rsa(bits: usize) -> Result<Self> { - use nettle::{rsa, Yarrow}; + use nettle::{rsa, random::Yarrow}; use crate::crypto::mpis::{MPI, PublicKey}; let mut rng = Yarrow::default(); @@ -1133,7 +1133,7 @@ impl<R> Key4<SecretParts, R> /// signing/encryption pub fn generate_ecc(for_signing: bool, curve: Curve) -> Result<Self> { use nettle::{ - Yarrow, + random::Yarrow, ed25519, ed25519::ED25519_KEY_SIZE, curve25519, curve25519::CURVE25519_SIZE, ecc, ecdh, ecdsa, |