Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to establish Olm outbound session from fallback key (BAD_MAC error when verifying signature) #5120

Closed
BillCarsonFr opened this issue Nov 10, 2021 · 0 comments
Assignees
Labels
A-E2EE O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems

Comments

@BillCarsonFr
Copy link
Member

Steps to reproduce

Try to establish an olm session from an OTK of type fallback

What happened?

Signature will fail, because the signable json is only using 'key' where it should use the all json and only remove unsigned and signatures.

Only happens with fallback key as a new fallback field is present in the dict:

{
    "fallback": true,
    "key": "dQp6YuFhLbZ4...wBq2deKNmdpewSzc",
    "signatures": {
        "@XXXX:matrix.org": {
            "ed25519:EXRRRRRR": "R1NiKUQd+ZhvxMPZiFgcG/6Lm5.....h6RkF2+mdopOw+W8UB4YRBA"
        }
    }
}

Current:

- (NSDictionary *)signalableJSONDictionary
{
    return @{
             @"key": _value
             };
}

Expected from JS sdk:

    // prepare the canonical json: remove unsigned and signatures, and stringify with anotherjson
    const mangledObj = Object.assign({}, obj);
    if ("unsigned" in mangledObj) {
        delete mangledObj.unsigned;
    }
    delete mangledObj.signatures;
    const json = anotherjson.stringify(mangledObj);

Your phone model

No response

Operating system version

No response

Application version

No response

Homeserver

No response

Will you send logs?

No

@BillCarsonFr BillCarsonFr added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Nov 10, 2021
@stefanceriu stefanceriu self-assigned this Nov 11, 2021
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 11, 2021
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 11, 2021
@pixlwave pixlwave added O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Nov 12, 2021
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 15, 2021
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 15, 2021
…CryptoWhenStartingMXSession after setting up fallback key signature test.
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 17, 2021
stefanceriu added a commit to matrix-org/matrix-ios-sdk that referenced this issue Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems
Projects
None yet
Development

No branches or pull requests

3 participants