Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
f8ca3ab
Merge pull request #30 from BKSSMVenkateswarlu/master
BKSSMVenkateswarlu Sep 4, 2020
6c2d85b
Merge pull request #31 from cpathak/master
BKSSMVenkateswarlu Sep 9, 2020
fd2b2cb
Merge pull request #34 from cpathak/master
BKSSMVenkateswarlu Sep 23, 2020
cdd4ae7
Merge branch 'master' into jcop_support
Oct 2, 2020
e4484e9
JCOP Provider Implementation
Oct 5, 2020
b4a3d65
In update operation, the inputConsumed len is equal to input length
Oct 6, 2020
76c5c97
Added code for ECDSA No Digest
Oct 15, 2020
3e1b42d
Added no digest ecdsa file
Oct 19, 2020
021ddd0
Removed commented code and indentation
Oct 20, 2020
9c1771c
1. Removed native code for random number generation and used RandomData
Oct 21, 2020
9350e5e
Merge pull request #12 from BKSSMVenkateswarlu/master
Oct 22, 2020
a4ace6f
Support for RSA-OAEP encoding scheme
Oct 27, 2020
9f6252d
1. Renamed JCOP Provider to SGTMProvider
Nov 2, 2020
230c433
Renamed SGTMProvider to AndroidSEProvider
Nov 3, 2020
7125820
provisioning changes
Nov 8, 2020
153562b
Divided single provision command into sub functions
Nov 9, 2020
f50dece
Fixed issues while provisioning
Nov 9, 2020
8bfd984
1. Provision certificate chain with out using extra RAM.
Nov 12, 2020
0a3e7d5
Provision functionality split into 6 separate functions
Nov 16, 2020
64a13b9
Active state should not allow provision commands
Nov 18, 2020
6204fcd
Incorporated first level review comments in KMKeymasterApplet class
Nov 19, 2020
56885ee
Changed the instruction command values for provision cmds
Nov 19, 2020
411e7b9
Add Begin/End STATE, rm old B&R & mv handle statem
Nov 20, 2020
93211c5
Merge branch 'android_se_provider' into state_cleanups
BKSSMVenkateswarlu Nov 20, 2020
6303fb9
Merge pull request #37 from mdwivedi/state_cleanups
BKSSMVenkateswarlu Nov 20, 2020
91012bf
1. AES CCM to AES GCM while deriving the key.
Nov 20, 2020
7c1fc4b
Modified Applet state machine
Nov 22, 2020
0259bef
1. Rearranged the Instruction set.
Nov 23, 2020
eff52b7
1. Modified certChain command.
Nov 24, 2020
7421351
Update KMKeymasterApplet.java
mdwivedi Nov 24, 2020
cbed872
Removed BackupRestoreApplet
Nov 24, 2020
140a3a4
Removed OracleSimProvider
Nov 24, 2020
8d36fec
Removed unused function getNumberOfCerts from SEProvider
Nov 24, 2020
60d22ce
Merge pull request #39 from mdwivedi/patch-1
BKSSMVenkateswarlu Nov 24, 2020
ce57214
Moved all time related functions under Provider implementation with c…
Nov 25, 2020
39707e2
Removed Backuprestore classes from AndroidSEProvider
Nov 25, 2020
fdf660d
1. add sendError OK inside addRngEntropy which is missing
Nov 25, 2020
b3d0f18
Support for Amendment H
Nov 26, 2020
f0a812d
made provision to send long bytes in getCertificateChain
Nov 26, 2020
61db464
Removed KMKeymasterStore.java file
Nov 26, 2020
34c5c2c
Added vendorPatchLevel and BootPatchLevel to SetBootParams
Nov 26, 2020
23abfa7
Added reclaimable memory and getAvailable memroy functions in Reposit…
Nov 28, 2020
0fe6b2f
Modified KMFunctionalTest code as per latest provision changes.
Nov 28, 2020
6bd8527
1. Corrected the spelling in the function documentation.
Nov 28, 2020
6662144
Resructured code and related changes
cpathak Nov 28, 2020
01cf309
Merge pull request #40 from cpathak/RestructuredCode
BKSSMVenkateswarlu Nov 29, 2020
028e182
Added new function isUpgrading inside KMSEProvider
Nov 29, 2020
6b62566
Update README.md
BKSSMVenkateswarlu Nov 30, 2020
1a06199
Update README.md
BKSSMVenkateswarlu Nov 30, 2020
0b26602
Added a protected function validateApduHeader so that subclass of KMK…
Nov 30, 2020
438583a
1. Moved provision and setbootparams in a separate file.
Dec 1, 2020
bc37a2a
Merge branch 'provision_split' into android_se_provider
Dec 1, 2020
905692a
Merge pull request #13 from BKSSMVenkateswarlu/android_se_provider
Dec 1, 2020
eb732ac
Merge pull request #41 from divegeek/master
BKSSMVenkateswarlu Dec 1, 2020
fa957d0
Added provision_tool source
Dec 8, 2020
7e0f206
Fixed the VTS 4.1 EarlyBootEnded usecase with DeleteKey
Dec 8, 2020
e6672fd
1. Used libjsoncpp for parsing json file
Dec 9, 2020
f678ad2
Clear the certificate chain persisted in memory whenever provisionCer…
Dec 9, 2020
8ee0fb4
Merge branch 'master' into provision_support
Jan 11, 2021
a816c19
HAL fixes shared by NXP team.
Jan 12, 2021
8a36d02
Create operation handle map in HAL to differentiate between public an…
Jan 13, 2021
39357b5
Pass hal generated operation handle to abort() call from update and f…
Jan 13, 2021
5c630f2
Added comments for the newly added code.
Jan 14, 2021
a25e9c0
updated provisioning tool
Jan 14, 2021
ed9c07a
Used Rand_bytes for hal generated operation handle.
Jan 15, 2021
20ca29b
Clearing the operation data inside the operation context
Jan 15, 2021
8e97a45
Added comments for getBlockAlignedData function
Jan 17, 2021
b386c0b
Merge pull request #42 from BKSSMVenkateswarlu/hal_fixes
BKSSMVenkateswarlu Jan 17, 2021
25325b3
Handle extended errorcodes in HAL
Jan 19, 2021
407a8b7
1. Exception handling for CryptoException and Generic exceptions
Jan 19, 2021
f297133
Remove trusted confirmation related code
Jan 20, 2021
6c97a25
Corrected the extended error code values.
Jan 20, 2021
489e175
certificate chain input validation
Jan 20, 2021
7d34a13
1. Renamed INS_SHARED_SECRET to INS_PRESHARED_SECRET.
Jan 21, 2021
6061381
Fixed the issue with KMFunctionalTest
Jan 21, 2021
2023d6d
Renamed SHARED_SECRET to PRESHARED_SECRET
Jan 21, 2021
fbd4eab
Merge pull request #43 from BKSSMVenkateswarlu/applet_fixes
BKSSMVenkateswarlu Jan 21, 2021
1534f3c
Merge pull request #44 from BKSSMVenkateswarlu/handle_extended_errorc…
BKSSMVenkateswarlu Jan 21, 2021
5aae09d
Corrected the month milliseconds hex value
Jan 21, 2021
41d879b
Merge pull request #45 from BKSSMVenkateswarlu/applet_fixes
BKSSMVenkateswarlu Jan 21, 2021
3dadaad
Removed authenticationIdentifier from cert params
Jan 21, 2021
32cd4a1
Merge pull request #46 from BKSSMVenkateswarlu/handle_extended_errorc…
BKSSMVenkateswarlu Jan 21, 2021
ee1228f
Fixed the issue with keyblob decryption with AndroidSEProvider
Jan 21, 2021
f216001
Remove MAX_USES_PER_BOOT related code as it is not supported by stron…
Jan 22, 2021
fe1f2fc
generate random number for operation handle
Jan 22, 2021
f80df71
Corrected the condition for SE provisioned status
Jan 22, 2021
89cbcc4
Corrected the condition for SE provisioned status
Jan 22, 2021
7e65c62
Merge branch 'master' into provision_support
Jan 23, 2021
bca5999
make provision as separate library
Jan 25, 2021
2134a5e
Removed sample_json.txt
Jan 25, 2021
dc379c7
Added uninit function
Jan 25, 2021
697a040
modified the function to init and uninit
Jan 26, 2021
6dcb7ce
1. Renamed the certiicate and key file names in sample_json.txt
Jan 27, 2021
8f6e409
Store master key as Key object rather than as a byte array
Jan 29, 2021
3a13691
Merge branch 'master' into provision_support
Jan 31, 2021
d32c0c0
updated the sample_json.txt to use 3 certificates instead of 2
Jan 31, 2021
ee9ddb3
Removed the changes relating to storing master key as Key object
Feb 1, 2021
9064376
Merge branch 'master' into provision_support
Feb 1, 2021
4c9794e
Added log statements
Feb 2, 2021
e51ab8a
1. Corrected the convertToDate algorithm to generate correct time and
Feb 2, 2021
9d608aa
Merge branch 'master' into provision_support
Feb 2, 2021
5d3413e
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
4fed428
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
f8ae39f
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
be8e975
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
7899e3b
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
91cc7fb
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
8d32e80
Update README.md
BKSSMVenkateswarlu Feb 2, 2021
66d366a
Corrected the tag EARLY_BOOT_ENDED to EARLY_BOOT_ONLY
Feb 3, 2021
6ab0667
store secrets as keyobjects instead as byte arrays.
Feb 5, 2021
64e37fa
Updated the documentation comments
Feb 6, 2021
2699c29
Changed the key derivation alogorithm to hmac sign
Feb 6, 2021
b27520b
1. Removed unused functions in KMAESKey.java
Feb 7, 2021
b6f8ce6
Update JavacardKeymaster4Device.cpp
BKSSMVenkateswarlu Feb 7, 2021
cc53a65
Added Copyright comment
Feb 7, 2021
3fecf13
Removed commented code
Feb 7, 2021
04b3b70
Merge pull request #47 from BKSSMVenkateswarlu/secrets_as_keyobjects
BKSSMVenkateswarlu Feb 7, 2021
af0de2f
Added few debug statements
Feb 8, 2021
530cb67
Fixed the issue with RSA private and public key buffer while copying
Feb 9, 2021
d4928a7
Added testDesEcbPkcs7PaddingCorrupted test function
Feb 9, 2021
182ca26
Removed unused imports
Feb 9, 2021
c766d68
Removed unused/commented code.
Feb 9, 2021
4c4c49d
Merge pull request #48 from BKSSMVenkateswarlu/test_master
BKSSMVenkateswarlu Feb 9, 2021
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
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
-out EXP JCA CAP
-exportpath api_export_files_3.1.0
-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 com.android.javacard.keymaster.KMKeymasterApplet
-exportpath ../../AndroidSEProvider/api_export_files_3.0.5
-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 com.android.javacard.keymaster.KMAndroidSEApplet
com.android.javacard.keymaster
0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0
5 changes: 5 additions & 0 deletions Applet/AndroidSEProvider/AndroidSE_3_1_0.opt
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
-out EXP JCA CAP
-exportpath ../../AndroidSEProvider/api_export_files_3.1.0
-applet 0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1:0x1 com.android.javacard.keymaster.KMAndroidSEApplet
com.android.javacard.keymaster
0xa0:0x0:0x0:0x0:0x62:0x3:0x1:0xc:0x1 1.0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,245 @@
// converted by version 1.3
// on Wed Feb 14 10:43:54 CET 2018

.package org/globalplatform/upgrade {
.aid 0xA0:0x0:0x0:0x1:0x51:0x7;
.version 1.1;

.imports {
0xA0:0x0:0x0:0x0:0x62:0x0:0x1 1.0; //java/lang
}

.constantPool {
// 0
staticMethodRef 0.0.0()V; // java/lang/Object.<init>()V
}

.interface public abstract Element 0 {

.fields {
public static final byte TYPE_SIMPLE = 1; // B
public static final byte TYPE_MAPPED = 2; // B
public static final short SIZE_BOOLEAN = 1; // S
public static final short SIZE_BYTE = 1; // S
public static final short SIZE_SHORT = 2; // S
}

.method public abstract write(Z)Lorg/globalplatform/upgrade/Element; 0 {
}

.method public abstract write(B)Lorg/globalplatform/upgrade/Element; 1 {
}

.method public abstract write(S)Lorg/globalplatform/upgrade/Element; 2 {
}

.method public abstract write(Ljava/lang/Object;)Lorg/globalplatform/upgrade/Element; 3 {
.descriptor Ljava/lang/Object; 0.0;

}

.method public abstract canWriteBoolean()S 4 {
}

.method public abstract canWriteByte()S 5 {
}

.method public abstract canWriteShort()S 6 {
}

.method public abstract canWriteObject()S 7 {
}

.method public abstract initRead()V 8 {
}

.method public abstract readBoolean()Z 9 {
}

.method public abstract readByte()B 10 {
}

.method public abstract readShort()S 11 {
}

.method public abstract readObject()Ljava/lang/Object; 12 {
.descriptor Ljava/lang/Object; 0.0;

}

.method public abstract canReadBoolean()S 13 {
}

.method public abstract canReadByte()S 14 {
}

.method public abstract canReadShort()S 15 {
}

.method public abstract canReadObject()S 16 {
}

}

.interface public abstract MappedElement 1 {

.superInterfaces {
Element;
}

.method public abstract write(Z)Lorg/globalplatform/upgrade/Element; 0 {
}

.method public abstract write(B)Lorg/globalplatform/upgrade/Element; 1 {
}

.method public abstract write(S)Lorg/globalplatform/upgrade/Element; 2 {
}

.method public abstract write(Ljava/lang/Object;)Lorg/globalplatform/upgrade/Element; 3 {
.descriptor Ljava/lang/Object; 0.0;

}

.method public abstract canWriteBoolean()S 4 {
}

.method public abstract canWriteByte()S 5 {
}

.method public abstract canWriteShort()S 6 {
}

.method public abstract canWriteObject()S 7 {
}

.method public abstract initRead()V 8 {
}

.method public abstract readBoolean()Z 9 {
}

.method public abstract readByte()B 10 {
}

.method public abstract readShort()S 11 {
}

.method public abstract readObject()Ljava/lang/Object; 12 {
.descriptor Ljava/lang/Object; 0.0;

}

.method public abstract canReadBoolean()S 13 {
}

.method public abstract canReadByte()S 14 {
}

.method public abstract canReadShort()S 15 {
}

.method public abstract canReadObject()S 16 {
}

.method public abstract getMappedObject()Ljava/lang/Object; 17 {
.descriptor Ljava/lang/Object; 0.0;

}

.method public abstract setMappedObject(Ljava/lang/Object;)Lorg/globalplatform/upgrade/Element; 18 {
.descriptor Ljava/lang/Object; 0.0;

}

}

.interface public abstract OnUpgradeListener 2 {

.method public abstract onSave()Lorg/globalplatform/upgrade/Element; 0 {
}

.method public abstract onCleanup()V 1 {
}

.method public abstract onRestore(Lorg/globalplatform/upgrade/Element;)V 2 {
}

.method public abstract onConsolidate()V 3 {
}

}

.class public final UpgradeManager 3 extends 0.0 { // extends java/lang/Object

.publicMethodTable 1 {
equals(Ljava/lang/Object;)Z;
}

.packageMethodTable 0 {
}

.method private <init>()V {
.stack 1;
.locals 0;

L0: aload_0;
invokespecial 0; // java/lang/Object.<init>()V
return;
}

.method public static isUpgrading()Z 0 {
.stack 1;
.locals 0;

L0: sconst_0;
sreturn;
}

.method public static getPreviousPackageVersion()S 1 {
.stack 1;
.locals 0;

L0: sconst_0;
sreturn;
}

.method public static checkPreviousPackageAID([BSB)Z 2 {
.stack 1;
.locals 0;

L0: sconst_0;
sreturn;
}

.method public static createElement(BSS)Lorg/globalplatform/upgrade/Element; 3 {
.stack 1;
.locals 0;

L0: aconst_null;
areturn;
}

.method public static matchMappedElement(Ljava/lang/Object;)Lorg/globalplatform/upgrade/MappedElement; 4 {
.stack 1;
.locals 0;

.descriptor Ljava/lang/Object; 0.0;

L0: aconst_null;
areturn;
}

.method public static nonNullReference()Ljava/lang/Object; 5 {
.stack 1;
.locals 0;

.descriptor Ljava/lang/Object; 0.0;

L0: aconst_null;
areturn;
}

}

}
77 changes: 77 additions & 0 deletions Applet/AndroidSEProvider/build.xml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
<project name="AndroidSEProvider" default = "default">
<import file="../build.xml" as="common" />
<!-- Properties - other properties are included from build_common.xml -->
<target name = "androidse.init" >
<property environment="env"/>
<property name="common.src.dir" value="${applet.common.src}"/>
<property name="androidse.src.dir" value="${AndroidSE.dir}/src"/>
<property name="androidse.home" value="${env.JC_HOME_SIMULATOR}"/>
<property name="build.sysclasspath" value="ignore" />
<!-- Taskdefs -->
<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath> <pathelement location="${androidse.home}/lib/ant-contrib-1.0b3.jar"/>
</classpath>
</taskdef>
<taskdef name="convert"
classname="com.sun.javacard.ant.tasks.ConverterTask"
classpath="${androidse.home}/lib/jctasks.jar" />
<taskdef name="verifycap"
classname="com.sun.javacard.ant.tasks.VerifyCapTask"
classpath="${androidse.home}/lib/jctasks.jar" />
<path id="androidse.jars"
description="Sets the classpath to Java Card API">
<pathelement path="${AndroidSE.dir}/lib/gpapi-upgrade.jar"/>
<pathelement path="${androidse.home}/lib/api_classic.jar"/>
<pathelement path="${androidse.home}/lib/api_classic_annotations.jar"/>
</path>
<path id="androidse.tools.jars"
description="Sets the classpath to Java Card API and tools">
<pathelement path="${AndroidSE.dir}/lib/gpapi-upgrade.jar"/>
<pathelement path="${androidse.home}/lib/api_classic.jar" />
<pathelement path="${androidse.home}/lib/tools.jar" />
<pathelement path="${androidse.home}/lib/api_classic_annotations.jar" />
</path>
<mkdir dir="${applet.build.dir}/classes"/>
</target>

<target name="androidse.compile" depends="androidse.init">
<pathconvert property="classpath" refid="androidse.jars"/>
<javac
destdir="${applet.build.dir}/classes"
source="7"
target="7"
debug="yes"
includeantruntime="no"
bootclasspath="${classpath}">
<src path="${common.src.dir}"/>
<src path="${androidse.src.dir}"/>
</javac>
</target>

<target name="androidse.convert" depends="androidse.compile">
<convert dir="${applet.build.dir}/classes" Configfile="${AndroidSE.dir}/AndroidSE_3_0_5.opt">
<classpath refid="androidse.tools.jars"/>
</convert>

<copy todir="${applet.build.dir}" flatten="true">
<fileset dir="${applet.build.dir}/classes">
<include name="**/*.cap"/>
<include name="**/*.jca"/>
<include name="**/*.exp"/>
</fileset>
<regexpmapper from="(.*)\.(.*)"
to="AndroidSE.\2"
casesensitive="yes"/>
</copy>
</target>

<target name="androidse.verify" depends="androidse.convert">
<verifycap capfile="${applet.build.dir}/AndroidSE.cap" outfile="${applet.build.dir}/digest.txt">
<exportfiles dir="${AndroidSE.dir}/api_export_files_3.0.5" includes="**/*.exp"/>
<classpath refid="androidse.tools.jars"/>
</verifycap>
</target>

<target name="default" depends="androidse.verify" />

</project>
Binary file addedApplet/AndroidSEProvider/lib/gpapi-upgrade.jar
Binary file not shown.
Loading