Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion integration/test/MLS/Util.hs
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ createApplicationMessage cid messageContent = do
message <-
mlscli
cid
["message", "--group-in", "<group-in>", messageContent, "--group-out", "<group-out>"]
["message", "--group", "<group-in>", messageContent, "--group-out", "<group-out>"]
Nothing

pure
Expand Down
4 changes: 2 additions & 2 deletions libs/wire-api/src/Wire/API/MLS/Credential.hs
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,13 @@ instance ParseMLS ClientIdentity where
either fail pure . (mkDomain . T.pack) =<< many' anyChar
pure $ ClientIdentity dom uid cid

-- format of the x509 client identity: {userid}!{deviceid}@{host}
-- format of the x509 client identity: {userid}%21{deviceid}@{host}
parseX509ClientIdentity :: Get ClientIdentity
parseX509ClientIdentity = do
b64uuid <- getByteString 22
uidBytes <- either fail pure $ B64URL.decodeUnpadded b64uuid
uid <- maybe (fail "Invalid UUID") (pure . Id) $ fromByteString (L.fromStrict uidBytes)
char '!'
string "%21"
cid <- ClientId <$> hexadecimal
char '@'
dom <-
Expand Down
1 change: 1 addition & 0 deletions libs/wire-api/src/Wire/API/MLS/KeyPackage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ module Wire.API.MLS.KeyPackage
kpRef',
KeyPackageTBS (..),
KeyPackageRef (..),
sanIdentity,
)
where

Expand Down
11 changes: 9 additions & 2 deletions libs/wire-api/test/unit/Test/Wire/API/MLS.hs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,16 @@ tests =
testCase "parse application message" testParseApplication,
testCase "parse welcome and groupinfo message" testParseWelcomeAndGroupInfo,
testCase "key package ref" testKeyPackageRef,
testCase "create signed remove proposal" testRemoveProposalMessageSignature
testCase "create signed remove proposal" testRemoveProposalMessageSignature,
testCase "parse client identity" testParseClientIdentity
]

testParseClientIdentity :: IO ()
testParseClientIdentity = do
let cid = "wireapp://qHiDLsbkT2-p9uSJsmrZ_A%217f39900830740008@wire.com"
let actual = sanIdentity cid
show <$> actual @?= Right "a878832e-c6e4-4f6f-a9f6-e489b26ad9fc:7f39900830740008@wire.com"

testParseKeyPackage :: IO ()
testParseKeyPackage = do
alice <- randomIdentity
Expand Down Expand Up @@ -123,7 +130,7 @@ testParseApplication = do
msgData <- withSystemTempDirectory "mls" $ \tmp -> do
void $ spawn (cli qcid tmp ["init", qcid]) Nothing
groupJSON <- spawn (cli qcid tmp ["group", "create", "Zm9v"]) Nothing
spawn (cli qcid tmp ["message", "--group-in", "-", "hello"]) (Just groupJSON)
spawn (cli qcid tmp ["message", "--group", "-", "hello"]) (Just groupJSON)

msg <- case decodeMLS' @Message msgData of
Left err -> assertFailure (T.unpack err)
Expand Down
10 changes: 5 additions & 5 deletions nix/pkgs/mls-test-cli/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ rustPlatform.buildRustPackage rec {
src = fetchFromGitHub {
owner = "wireapp";
repo = "mls-test-cli";
rev = "baaa5c78411a5bf6d697803276b991523c111631";
sha256 = "sha256-M6bWB5hWl+WSblcH6L+AyGD+7ef9TvRs8wKYq7lJyS8=";
rev = "7d97772f52f8dfaae79d4c73de2e32b551d2d0bf";
sha256 = "sha256-OU/bEz98Gh/HPVymGpoQ2K4ccpTZIV0xwsgEEnakOws=";
};
pname = "mls-test-cli";
version = "0.9.0";
version = "0.10.2";
cargoLock = {
lockFile = "${src}/Cargo.lock";
outputHashes = {
"hpke-0.10.0" = "sha256-T1+BFwX6allljNZ/8T3mrWhOejnUU27BiWQetqU+0fY=";
"openmls-1.0.0" = "sha256-tAIm8+IgubNnU2M2A5cxHY5caiEQmisw73I9/cqfvUc=";
"safe_pqc_kyber-0.6.0" = "sha256-Ch1LA+by+ezf5RV0LDSQGC1o+IWKXk8IPvkwSrAos68=";
"openmls-1.0.0" = "sha256-nyIMAlTy7CTV0bVQ0ytamKHpERgtsVKTX4zv7aHzemo=";
"safe_pqc_kyber-0.6.2" = "sha256-9t+IIohCJcMIWRtqLA0idyMmjev82BtpST15Tthlge4=";
"tls_codec-0.3.0" = "sha256-IO6tenXKkC14EoUDp/+DtFNOVzDfOlLu8K1EJI7sOzs=";
};
};
Expand Down