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

Check that signatureMask isn't an empty array #26

Merged
merged 2 commits into from
Dec 8, 2022

Conversation

matias-la
Copy link
Contributor

The verify() function decides whether to succeed of fail based on the result of the following code:

        // Step 6: Check the verification state produced by the Android App statement matcher
        boolean result = true;
        for (boolean b : signatureMask) {
            if (!b) {
                result = false;
                break;
            }
        }

        return result;

If for some reason signatureMask turned out to be an empty array, the for loop would never be reached andverify() would always return true. Therefore, the verification logic could be bypassed. This change ensures that the code throws an exception in the (very unlikely) case that signatureMask is an empty array.

If for some reason signatureMask turned out to be an empty array,
verify() would always return true and the verification logic could be
bypassed. This change ensures that the code throws an exception in the
unlikely case that signatureMask is an empty array.
Copy link

@kewde kewde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@sdlaver sdlaver merged commit b4cb100 into solana-mobile:main Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants