Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: smartgpg-test-applet

# Run this workflow every time a new commit pushed to your repository
on: push
on:
push:
workflow_dispatch:

jobs:
applet_tests:
Expand Down Expand Up @@ -52,3 +54,10 @@ jobs:
python3 .github/workflows/card-status.py;
# main tests
python3 .github/workflows/test_SmartPGP.py;

- name: Upload All Artifacts file
uses: actions/upload-artifact@v4
with:
name: "SmartPGPApplet-${{ github.run_number }}.cap"
path: |
./SmartPGPApplet.cap
2 changes: 1 addition & 1 deletion src/fr/anssi/smartpgp/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ of the License, or (at your option) any later version.
public final class Constants {

protected static final short INTERNAL_BUFFER_MAX_LENGTH =
(short)0x500;
(short)0x730; // to deal with RSA 4096 bits

protected static final short APDU_MAX_LENGTH = (short)0x400;

Expand Down
6 changes: 5 additions & 1 deletion src/fr/anssi/smartpgp/PGPKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,15 @@ protected final void setAttributes(final ECCurves ec,
return;
}
if((Util.getShort(buf, (short)(off + 1)) < 2048) ||
(Util.getShort(buf, (short)(off + 3)) != 0x11) ||
(Util.getShort(buf, (short)(off + 3)) < 0x11) ||
(buf[(short)(off + 5)] < 0) || (buf[(short)(off + 5)] > 3)) {
ISOException.throwIt(ISO7816.SW_WRONG_DATA);
return;
}
if (Util.getShort(buf, (short) (off + 3)) > 0x11) {
buf[(short) (off + 3)] = 0x00;
buf[(short) (off + 4)] = 0x11;
}
break;

case 0x12:
Expand Down
Loading