Skip to content

Commit 10ef27c

Browse files
committed
Change uuid to bytebuf
1 parent 3af3f80 commit 10ef27c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/bitwarden-crypto/src/security_state.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use std::str::FromStr;
2424

2525
use base64::{engine::general_purpose::STANDARD, Engine};
2626
use serde::{Deserialize, Serialize};
27+
use serde_bytes::ByteBuf;
2728

2829
use crate::{
2930
cose::CoseSerializable, error::EncodingError, util::FromStrVisitor, CryptoError, KeyIds,
@@ -44,7 +45,7 @@ export type SignedSecurityState = string;
4445
#[derive(Serialize, Deserialize)]
4546
#[serde(rename_all = "camelCase")]
4647
pub struct SecurityState {
47-
entity_id: String,
48+
entity_id: ByteBuf,
4849
version: u64,
4950
}
5051

@@ -53,7 +54,7 @@ impl SecurityState {
5354
/// The user needs to be a v2 encryption user.
5455
pub fn initialize_for_user(user_id: uuid::Uuid) -> Self {
5556
SecurityState {
56-
entity_id: user_id.to_string(),
57+
entity_id: user_id.as_bytes().to_vec().into(),
5758
version: 1,
5859
}
5960
}

0 commit comments

Comments
 (0)