Backports to beta (#1919)
* RPC errors & logs (#1845) * Refactoring errors in RPC * Updating jsonrpc-core * Fixing code_at * Avoid mentioning obvious segments in proof [ci:skip] * fixed cache_manager lock order * Purging .derefs, fixing clippy warnings. (#1890) * Fixing clippy warnings * Purging derefs * Simplifying engine derefs * Simplifying more engine derefs * Adding more details to miner log * fixed #1889, .DS_Store is no longer treated as key file (#1892) * fixed #1889, .DS_Store is no longer treated as key file * ethstore filters directories, hidden files and common system files * fixed compiling * fix regression with geth dir * fix regression with geth dir * Fix ipc compilation and add ipc feature to test targets (#1902) * fix compilation and add it to the ci run * no separator? * use quotes and spaces * RocksDB version bump * Don't return deleted nodes that are not yet flushed (#1908) * polling & connection timeouts (#1910) * Peers RPC + UI displaying active/connected/max peers (#1915) * Peers API * Bumping Parity-UI * Fixing tests * Save nodes removed from backing_overlay until commit (#1917)
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Parity. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use std::ops::{Deref, DerefMut};
|
||||
use ethkey::{KeyPair, sign, Address, Secret, Signature, Message};
|
||||
use {json, Error, crypto};
|
||||
use crypto::Keccak256;
|
||||
@@ -87,7 +86,7 @@ impl Crypto {
|
||||
let mut ciphertext = [0u8; 32];
|
||||
|
||||
// aes-128-ctr with initial vector of iv
|
||||
crypto::aes::encrypt(&derived_left_bits, &iv, secret.deref(), &mut ciphertext);
|
||||
crypto::aes::encrypt(&derived_left_bits, &iv, &**secret, &mut ciphertext);
|
||||
|
||||
// KECCAK(DK[16..31] ++ <ciphertext>), where DK[16..31] - derived_right_bits
|
||||
let mac = crypto::derive_mac(&derived_right_bits, &ciphertext).keccak256();
|
||||
@@ -123,7 +122,7 @@ impl Crypto {
|
||||
|
||||
match self.cipher {
|
||||
Cipher::Aes128Ctr(ref params) => {
|
||||
crypto::aes::decrypt(&derived_left_bits, ¶ms.iv, &self.ciphertext, secret.deref_mut())
|
||||
crypto::aes::decrypt(&derived_left_bits, ¶ms.iv, &self.ciphertext, &mut *secret)
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ fn execute<S, I>(command: I) -> Result<String, Error> where I: IntoIterator<Item
|
||||
} else if args.cmd_import {
|
||||
let src = try!(key_dir(&args.flag_src));
|
||||
let dst = try!(key_dir(&args.flag_dir));
|
||||
let accounts = try!(import_accounts(src.deref(), dst.deref()));
|
||||
let accounts = try!(import_accounts(*src, *dst));
|
||||
Ok(format_accounts(&accounts))
|
||||
} else if args.cmd_import_wallet {
|
||||
let wallet = try!(PresaleWallet::open(&args.arg_path));
|
||||
|
||||
@@ -22,6 +22,8 @@ use ethkey::Address;
|
||||
use {json, SafeAccount, Error};
|
||||
use super::KeyDirectory;
|
||||
|
||||
const IGNORED_FILES: &'static [&'static str] = &["thumbs.db"];
|
||||
|
||||
#[cfg(not(windows))]
|
||||
fn restrict_permissions_to_owner(file_path: &Path) -> Result<(), i32> {
|
||||
use std::ffi;
|
||||
@@ -62,7 +64,14 @@ impl DiskDirectory {
|
||||
.flat_map(Result::ok)
|
||||
.filter(|entry| {
|
||||
let metadata = entry.metadata();
|
||||
metadata.is_ok() && !metadata.unwrap().is_dir()
|
||||
let file_name = entry.file_name();
|
||||
let name = file_name.to_str().unwrap();
|
||||
// filter directories
|
||||
metadata.is_ok() && !metadata.unwrap().is_dir() &&
|
||||
// hidden files
|
||||
!name.starts_with(".") &&
|
||||
// other ignored files
|
||||
!IGNORED_FILES.contains(&name)
|
||||
})
|
||||
.map(|entry| entry.path())
|
||||
.collect::<Vec<PathBuf>>();
|
||||
|
||||
Reference in New Issue
Block a user