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

Add SecurityPolicy factory method for apps signed with the platform certificate #11239

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

mateusazis
Copy link
Contributor

Addresses: #11238

@ejona86 ejona86 requested a review from jdcormie May 30, 2024 16:44
Copy link
Member

@jdcormie jdcormie left a comment

Choose a reason for hiding this comment

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

We spoke a bit offline about how this seems just like a special case of oneOfSignatures.

binder/src/main/java/io/grpc/binder/SecurityPolicies.java Outdated Show resolved Hide resolved
@ejona86 ejona86 added the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jun 4, 2024
@grpc-kokoro grpc-kokoro removed the kokoro:run Add this label to a PR to tell Kokoro the code is safe and tests can be run label Jun 4, 2024
@jdcormie
Copy link
Member

jdcormie commented Jun 5, 2024

Looks like the check failures above are real:

/grpc-java/binder/src/main/java/io/grpc/binder/SecurityPolicies.java:125: warning: [static] static variable should be qualified by type name, PackageManager, instead of by an expression
                        "android", packageManager.GET_SIGNING_CERTIFICATES);
                                                 ^
/grpc-java/binder/src/main/java/io/grpc/binder/SecurityPolicies.java:133: warning: [deprecation] signatures in PackageInfo has been deprecated
                      ImmutableList.copyOf(platformPackageInfo.signatures))
                                                              ^
error: warnings found and -Werror specified

@mateusazis
Copy link
Contributor Author

Looks like the check failures above are real:

/grpc-java/binder/src/main/java/io/grpc/binder/SecurityPolicies.java:125: warning: [static] static variable should be qualified by type name, PackageManager, instead of by an expression
                        "android", packageManager.GET_SIGNING_CERTIFICATES);
                                                 ^
/grpc-java/binder/src/main/java/io/grpc/binder/SecurityPolicies.java:133: warning: [deprecation] signatures in PackageInfo has been deprecated
                      ImmutableList.copyOf(platformPackageInfo.signatures))
                                                              ^
error: warnings found and -Werror specified

The first warning is addressed.

For the second one, I made the code more compliant with the new post SDK 27 APIs (copied a bit from checkPackageSignature). Let me know if it works now or if we need a Lint suppression.

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.

5 participants