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

Android NFC signing #523

Merged
merged 24 commits into from
Apr 30, 2024
Merged

Android NFC signing #523

merged 24 commits into from
Apr 30, 2024

Conversation

lauris71
Copy link
Contributor

@lauris71 lauris71 commented Apr 4, 2024

MOPPAND-1170

Signed-off-by: Firstname Lastname [email protected]

Lauris Kaplinski and others added 19 commits August 30, 2023 14:08
Signed-off-by: Raul Metsma <[email protected]>
Signed-off-by: Lauris Kaplinski <[email protected]>
Signed-off-by: Lauris Kaplinski <[email protected]>
Signed-off-by: Lauris Kaplinski <[email protected]>
Squashed commits:
[548e2dd] Fixed some minor warnings about unused variables and potential null dereference

Signed-off-by: Lauris Kaplinski <[email protected]> (+1 squashed commit)
Squashed commits:
[46ea501] Removed commented out code and reverted some AndroidStudio rearrangements

Signed-off-by: Lauris Kaplinski <[email protected]> (+1 squashed commit)
Squashed commits:
[87e91ca] Update app/src/main/java/ee/ria/DigiDoc/android/Activity.java

Co-authored-by: Raul Metsma <[email protected]> (+1 squashed commit)
Squashed commits:
[45df8a0] Some minor accessibility fixes

Signed-off-by: Lauris Kaplinski <[email protected]>
Signed-off-by: Lauris Kaplinski <[email protected]>
Signed-off-by: Lauris Kaplinski <[email protected]>

# Conflicts:
#	app/src/main/java/ee/ria/DigiDoc/android/signature/update/nfc/NFCOnSubscribe.java
Signed-off-by: Lauris Kaplinski <[email protected]>
public final int start;
public final int end;

public TLV(byte[] data, int start, int end) throws NFCException {

Check notice

Code scanning / CodeQL

Useless parameter

The parameter 'end' is never used.
private byte[] decryptNonce(byte[] encryptedNonce, byte[] CAN) throws NoSuchPaddingException, InvalidKeyException, NoSuchAlgorithmException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {
byte[] decryptionKey = createKey(CAN, (byte) 3);
Cipher cipher = Cipher.getInstance("AES/CBC/NoPadding");
cipher.init(Cipher.DECRYPT_MODE, new SecretKeySpec(decryptionKey, "AES"), new IvParameterSpec(new byte[16]));

Check failure

Code scanning / CodeQL

Using a static initialization vector for encryption

A [static initialization vector](1) should not be used for encryption.

private byte[] encryptDecryptData(byte[] data, int mode) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidKeyException, BadPaddingException, IllegalBlockSizeException, InvalidAlgorithmParameterException {
SecretKeySpec secretKeySpec = new SecretKeySpec(keyEnc, "AES");
Cipher cipher = Cipher.getInstance("AES/ECB/PKCS5Padding");

Check failure

Code scanning / CodeQL

Use of a broken or risky cryptographic algorithm

Cryptographic algorithm [AES/ECB/PKCS5Padding](1) is weak and should not be used.
@Counter178 Counter178 merged commit c956cdc into open-eid:master Apr 30, 2024
3 of 4 checks passed
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.

4 participants