From 73c7fb87e8b15b329ad2e16c2c3d748e7e1fde51 Mon Sep 17 00:00:00 2001 From: Jackson Sandland Date: Thu, 10 May 2018 17:15:53 -0700 Subject: [PATCH] signature.rs - panic cleanup --- src/signature.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/signature.rs b/src/signature.rs index c2136556f4..8e03a696d2 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -19,8 +19,8 @@ impl KeyPairUtil for Ed25519KeyPair { /// Return a new ED25519 keypair fn new() -> Self { let rng = rand::SystemRandom::new(); - let pkcs8_bytes = signature::Ed25519KeyPair::generate_pkcs8(&rng).expect("failed to generate_pkcs8"); - signature::Ed25519KeyPair::from_pkcs8(untrusted::Input::from(&pkcs8_bytes)).expect("failed to construct Ed25519KeyPair") + let pkcs8_bytes = signature::Ed25519KeyPair::generate_pkcs8(&rng).expect("generate_pkcs8 in signature pb fn new"); + signature::Ed25519KeyPair::from_pkcs8(untrusted::Input::from(&pkcs8_bytes)).expect("from_pcks8 in signature pb fn new") } /// Return the public key for the given keypair