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

[Core] Remove call to setkeySize in KeyProvider18 #967

Merged
merged 6 commits into from
May 23, 2019
Merged

Conversation

mutablealligator
Copy link
Contributor

@mutablealligator mutablealligator commented May 19, 2019

Issue #, if available:

#964

Description of changes:

setKeySize is not available in API Level 18. The default key size used by RSA in KeyPairGeneratorSpec is 2048 when not specified. This change will use the default of 2048 in all API levels (18-22).

Added build automation for verifying if the fix works for API 18-22.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@mutablealligator mutablealligator added core Issues with the AWS Android Core library Pull Request labels May 19, 2019
@mutablealligator mutablealligator self-assigned this May 19, 2019
@@ -151,7 +151,6 @@ private void initializeRSAKeyFromKeyStore(Context context,
.setSerialNumber(BigInteger.TEN)
.setStartDate(start.getTime())
.setEndDate(end.getTime())
.setKeySize(RSA_KEY_SIZE)
Copy link
Contributor

Choose a reason for hiding this comment

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

The RSA_KEY_SIZE constant definition should also be removed. Potentially update the javadoc regarding the key size and how the default is used. Did we rule out splitting KeyProvider18 into 18 and 19?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the constant and updated the Javadoc. Since the default key size is 2048 bits, I recommend to not invoke the method and keep the implementation the same for 18-22.

Choose a reason for hiding this comment

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

Agreed. The default size will not be lowered in the future.

@mutablealligator mutablealligator force-pushed the keystore-fix branch 2 times, most recently from 510b615 to b101c43 Compare May 21, 2019 00:32
@minbi minbi merged commit eb47b6c into develop May 23, 2019
@minbi minbi deleted the keystore-fix branch May 23, 2019 23:42
awsmobilesdk pushed a commit to awsmobilesdk/aws-sdk-android that referenced this pull request Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Issues with the AWS Android Core library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants