[WIP] Security work While on holiday
This commit is contained in:
parent
a81ac4efca
commit
7f0231e3f1
109 changed files with 19694 additions and 5210 deletions
|
|
@ -1,11 +1,31 @@
|
|||
pub mod communication_value;
|
||||
pub mod data_value;
|
||||
|
||||
#[cfg(feature = "crypto")]
|
||||
pub use communication_value::EncryptedPayload;
|
||||
pub use communication_value::{CommunicationValue, MAX_WIRE_ID};
|
||||
pub use data_value::{DataKind, DataValue};
|
||||
pub use mtp_common::CodecError;
|
||||
pub mod protected;
|
||||
#[cfg(feature = "crypto")]
|
||||
pub mod relay;
|
||||
|
||||
pub use communication_value::CommunicationValue;
|
||||
#[cfg(feature = "crypto")]
|
||||
pub use data_value::{
|
||||
ApplicationProtectionPurpose, EncryptedValue, MtpProtectionPurpose, ProtectionError,
|
||||
ProtectionPolicy, ProtectionPurpose, ProtectionPurposeError, SignaturePolicy, SignedValue,
|
||||
};
|
||||
pub use data_value::{DataKind, DataValue, DecodeLimits};
|
||||
pub use mtp_common::{CodecError, TimeError, unix_time_millis};
|
||||
#[cfg(feature = "crypto")]
|
||||
pub use protected::{
|
||||
CURRENT_PROTECTED_VERSION, InMemoryReplayGuard, ProtectedError, ProtectedMessageBuilder,
|
||||
ReplayError, ReplayGuard, VerifiedProtectedMessage, open_protected, open_protected_with,
|
||||
open_protected_with_keys, protected_claimed_signer_id,
|
||||
};
|
||||
#[cfg(feature = "crypto")]
|
||||
pub use relay::{
|
||||
CURRENT_RELAY_VERSION, RelayError, SealedRelayBuilder, VerifiedRelayContent,
|
||||
VerifiedRelayMetadata, forward_relay_frame, open_relay_content,
|
||||
open_relay_content_with_keyrings, open_relay_content_with_keys, open_relay_metadata,
|
||||
open_relay_metadata_with, open_relay_metadata_with_keys, relay_metadata_claimed_signer_id,
|
||||
};
|
||||
|
||||
pub use mtp_type_map::{
|
||||
CommunicationType, CommunicationTypeId, DataType, DataTypeId, PROTOCOL_VERSION, TypeMap,
|
||||
|
|
@ -13,7 +33,12 @@ pub use mtp_type_map::{
|
|||
};
|
||||
|
||||
pub(crate) fn rand_u32() -> u32 {
|
||||
rand::random()
|
||||
loop {
|
||||
let value = rand::random();
|
||||
if value != 0 {
|
||||
return value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "registry")]
|
||||
|
|
|
|||
Loading…
Reference in a new issue