MCPcopy Create free account
hub / github.com/chatmail/core / test_from_slice_bad_data

Function test_from_slice_bad_data

src/key.rs:743–753  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

741
742 #[test]
743 fn test_from_slice_bad_data() {
744 let mut bad_data: [u8; 4096] = [0; 4096];
745 for (i, v) in bad_data.iter_mut().enumerate() {
746 *v = (i & 0xff) as u8;
747 }
748 for j in 0..(4096 / 40) {
749 let slice = &bad_data.get(j..j + 4096 / 2 + j).unwrap();
750 assert!(SignedPublicKey::from_slice(slice).is_err());
751 assert!(SignedSecretKey::from_slice(slice).is_err());
752 }
753 }
754
755 /// Tests workaround for Delta Chat core < 1.0.0
756 /// which parsed CRC24 at the end of ASCII Armor

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected