wala-rust

Unnamed repository; edit this file 'description' to name the repository.
Info | Log | Files | Refs | README | LICENSE

commit 0ef533d7bca38d36530933a7ed79174076209f3b
parent 20f09ad06e393f8895d3c92dfae9e450fa192f4c
Author: lash <dev@holbrook.no>
Date:   Sun,  9 Oct 2022 07:50:49 +0000

Use RSA key for single auth example

Diffstat:
Msrc/auth/pgp_sequoia.rs | 11+++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/auth/pgp_sequoia.rs b/src/auth/pgp_sequoia.rs @@ -68,6 +68,7 @@ fn check_sig_single(public_key: &Key<PublicParts, PrimaryRole>, signature_data: let mut hasher = Sha256::default(); let mut message_data: Vec<u8> = vec!(); message.read_to_end(&mut message_data); + debug!("checking mesageĀ {:?}", &message_data); hasher.update(&message_data); match v.verify_hash(&public_key, Box::new(hasher)) { Ok(v) => { @@ -255,6 +256,7 @@ mod tests { check_sig_single, check_sig_bundle, }; + use env_logger; #[test] @@ -314,8 +316,13 @@ mod tests { #[test] fn test_pgp_auth_single() { - let key_single_hex = "0462a9f5a916092b06010401da470f0101074061f06baae76d5115553019e50353890e498652fac873d78003e9e192dd9f3e13"; - let sig_foo_single_hex = "0401160a0006050262a9f5a9002109108b21a9d88b4a0c7f1621044ab95b491980f89789ae8fde8b21a9d88b4a0c7f2aba0100b7b06c424cdb67bba97463d2eb3035ead329f62c92fb6100b629df003748131200fd17e8b6dc866aa1662b93a17ff599334002de273b800fc7160634516187b41407"; + env_logger::init(); + + let key_single_hex = "045fa148e8010c00a990f4048c00e39d0b63980b1d3d8a71e4df8e3090588f50c0a0862c0ed57abdb701250b7de0e9b7c65ed1061bfd9b6a0b8333ec891c230841515b2352bb4054a790858dc5df9b44b82b67a0c787ab1674e74920bd4bab6654dad53445ef49c13ab0a027989ec9357d44c49b848963db50345627586823df8047ef0438d78944ba3f8f4369f92e081439f43ecc5d4fe481d06634cf6704823be3a0faf8956f4801bf05b7d4c3629fa63b37a39f5160ec2b88ae5051480bfeb23edb550c35e5d8754a96f0b52e71c6e6c26bc1311062380725e6797751d0a649f8403992c3b4892b10ffa8a948e75283e8b49e2382945366d4ffce85b52c600c4251f897eb9e05327db3a315411232777bb974a47ee4b6875ac4472d3e87d02c103d2d20d421e8ea26c5349e9c3f0c70c3daebf11befc0ea5815f4bf044e5be0a7c47378e09fd9b1ee88a618cfceedc6f905c2c5e0535f936716e4fa6b4205b9e0b153cb35aad8fca1a45492feca1707443d0f978c1751de9ab90b98eaf43d02e2a2093d567b6b0011010001"; + //let key_single_hex = "0462a9f5a916092b06010401da470f0101074061f06baae76d5115553019e50353890e498652fac873d78003e9e192dd9f3e13"; + + let sig_foo_single_hex = "04000108001d162104f3faf668e82ef5124d5187baef26f4682343f69205026334796a000a0910ef26f4682343f692dfa30c009187134c366ccd867442d55b2b722c6c3d3ffa273cfbd53ca2f00a7d36b7961a575ad79b75cdb90276edee565d19baa14a95296fcd4b7f3df856d20c3d9c5b8523a1a253e3071a486d437af97f4bf67978c065a3013191bd643893f8d0239cccdca6d31b19aa6e6b225dc339e34d395246cc7d3ea455c8c8b1528532f509194b935f8f81e7a1a22896f5029bda6c54cd38687e5e225a21122180f1cad630885b7a3fdfef8e5b2f5634e9bc55d24aff40c7723a156b88a074919fd904e42077e4c26c81c0e569dde6ebd7558217eea34079252ed5d0fc766c174d3d66c1366b43e463bc0c3ca693e6216020142a33f3f710e17cb1d1f6b657a1f01a59c847604424bfbfc555316815cdd2bf2ea78792a1399b768920a2bb640e5694ae0d9d12ac66c2b50b2913736711a4ad312e0a2d75f8911adce976774c03c851252aa6292141e92c2988a1cebde8c292892aa10c78cd6ec2a43449216ee1ded8a546d1199153ee54c92fb042ad0d8e5d31a2299e942aa500ba0a7c7e46b2edb23d56995947"; + //let sig_foo_single_hex = "0401160a0006050262a9f5a9002109108b21a9d88b4a0c7f1621044ab95b491980f89789ae8fde8b21a9d88b4a0c7f2aba0100b7b06c424cdb67bba97463d2eb3035ead329f62c92fb6100b629df003748131200fd17e8b6dc866aa1662b93a17ff599334002de273b800fc7160634516187b41407"; let key_single = hex::decode(&key_single_hex).unwrap(); let key_single_base64 = base64::encode(&key_single);