fix(protocol,storage): platform-aware client version and Android stub (TODO-010,011)
pick_client_version() now returns correct version per platform via cfg(target_os). keyring_load() on unsupported platforms returns StorageError instead of silently returning Ok(None).
This commit is contained in:
@@ -138,7 +138,26 @@ where
|
|||||||
/// `Version` enum at compile time; if upstream rotates the CSV the
|
/// `Version` enum at compile time; if upstream rotates the CSV the
|
||||||
/// build will fail loudly here rather than silently fall back.
|
/// build will fail loudly here rather than silently fall back.
|
||||||
fn pick_client_version() -> Version {
|
fn pick_client_version() -> Version {
|
||||||
Version::Windows_3_X_X__1
|
#[cfg(target_os = "windows")]
|
||||||
|
{
|
||||||
|
Version::Windows_5_0_0_beta51
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
{
|
||||||
|
Version::Linux_5_0_0_beta51
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "macos")]
|
||||||
|
{
|
||||||
|
Version::macOS_5_0_0_beta51
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "android")]
|
||||||
|
{
|
||||||
|
Version::Android_3_5_0__7
|
||||||
|
}
|
||||||
|
#[cfg(target_os = "ios")]
|
||||||
|
{
|
||||||
|
Version::iOS_3_5_6
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Typed configuration for a connection attempt.
|
/// Typed configuration for a connection attempt.
|
||||||
|
|||||||
@@ -270,7 +270,9 @@ impl IdentityFileStore {
|
|||||||
target_os = "ios"
|
target_os = "ios"
|
||||||
)))]
|
)))]
|
||||||
fn keyring_load(&self) -> Result<Option<[u8; 32]>, StorageError> {
|
fn keyring_load(&self) -> Result<Option<[u8; 32]>, StorageError> {
|
||||||
Ok(None)
|
Err(StorageError::SecureStore(
|
||||||
|
"keyring is not yet supported on this platform".into(),
|
||||||
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Persist the DEK in the platform keyring. Returns true on
|
/// Persist the DEK in the platform keyring. Returns true on
|
||||||
|
|||||||
Reference in New Issue
Block a user