solana/sdk
Christian Kamm cf58640937
Keypair: implement clone() (#26248)
* Keypair: implement clone()

This was not implemented upstream in ed25519-dalek to force everyone to
think twice before creating another copy of a potentially sensitive
private key in memory.

See https://github.com/dalek-cryptography/ed25519-dalek/issues/76

However, there are now 9 instances of
  Keypair::from_bytes(&keypair.to_bytes())
in the solana codebase and it would be preferable to have a function.

In particular since this also comes up when writing programs and can
cause users to either start messing with lifetimes or discover the
from_bytes() workaround themselves.

This patch opts to not implement the Clone trait. This avoids automatic
use in order to preserve some of the original "let developers think
twice about this" intention.

* Use Keypair::clone
2022-08-06 11:54:38 -06:00
..
benches Refactor: move instructions sysvar serialization out of Message (#22544) 2022-01-20 17:33:49 +08:00
bpf Copy changes made to a generated header file to its source 2022-07-30 10:38:53 -07:00
cargo-build-bpf Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
cargo-build-sbf Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
cargo-test-bpf Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
cargo-test-sbf Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
docker-solana Fix solana docker image 2021-10-09 20:35:39 +01:00
gen-headers Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
macro Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
program Fix sol_get_processed_sibling_instruction on 32-bit hosts (#26522) 2022-08-05 12:06:03 -07:00
src Keypair: implement clone() (#26248) 2022-08-06 11:54:38 -06:00
tests fix: renamed the internal wasm_bindgen init function to avoid collision 2022-03-10 11:33:24 -08:00
.gitignore Add wasm bindings for `Pubkey` and `Keypair` 2021-12-09 15:53:58 -08:00
Cargo.toml Bump Version to 1.11.6 (#26906) 2022-08-03 12:48:43 -05:00
README.md
build.rs
package.json Add wasm bindings for `Pubkey` and `Keypair` 2021-12-09 15:53:58 -08:00

README.md

Solana

Solana SDK

Use the Solana SDK Crate to write client side applications in Rust. If writing on-chain programs, use the Solana Program Crate instead.

More information about Solana is available in the Solana documentation.

The Solana Program Library provides examples of how to use this crate.

Still have questions? Ask us on Discord