mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-16 20:39:10 +00:00
Improve bls::SecretKey privacy (#1164)
* Improve bls::SecretKey privacy * Add missed file * Remove more methods from bls::SecretKey * Add as_bytes() to SecretKey, remove as_raw * Remove as_raw * Add back as_raw * Address review comments
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::json_keystore::{
|
||||
Aes128Ctr, ChecksumModule, Cipher, CipherModule, Crypto, EmptyMap, EmptyString, JsonKeystore,
|
||||
Kdf, KdfModule, Scrypt, Sha256Checksum, Version,
|
||||
};
|
||||
use crate::plain_text::PlainText;
|
||||
use crate::PlainText;
|
||||
use crate::Uuid;
|
||||
use bls::{Keypair, PublicKey, SecretKey};
|
||||
use crypto::{digest::Digest, sha2::Sha256};
|
||||
@@ -130,7 +130,7 @@ impl Keystore {
|
||||
uuid: Uuid,
|
||||
path: String,
|
||||
) -> Result<Self, Error> {
|
||||
let secret = PlainText::from(keypair.sk.as_raw().as_bytes());
|
||||
let secret: PlainText = keypair.sk.as_bytes();
|
||||
|
||||
let (cipher_text, checksum) = encrypt(secret.as_bytes(), password, &kdf, &cipher)?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user