summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-03-06 12:39:07 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-03-09 18:09:19 +0100
commit58d662c6d37dd1b0dccd4d0ce30290b8ede408e9 (patch)
treeab850355c6bcded1cba184db98263908736f1fc4 /openpgp
parentf484efee5bf61f7ce90d5383ba2f589fe03ae518 (diff)
openpgp: Update nettle to 7.0.0.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/Cargo.toml2
-rw-r--r--openpgp/src/crypto/asymmetric.rs2
-rw-r--r--openpgp/src/crypto/ecdh.rs2
-rw-r--r--openpgp/src/crypto/hash.rs14
-rw-r--r--openpgp/src/crypto/mod.rs2
-rw-r--r--openpgp/src/packet/key/mod.rs4
6 files changed, 13 insertions, 13 deletions
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,