Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b557e48
Merge pull request #2 from BKSSMVenkateswarlu/master
mdwivedi Feb 9, 2021
e896206
Update KMInteger.java
mdwivedi Feb 9, 2021
a6054cf
move_unsigned_compare to common code
Feb 9, 2021
48ec0ee
move_unsigned_compare to common code
Feb 9, 2021
5575105
code cleanup
Feb 10, 2021
2f15f3d
Removed public key operations from Applet and provider code
Feb 10, 2021
206c520
updated readROT function
Feb 10, 2021
96e16fe
Added validation for block mode
Feb 10, 2021
9b13537
Removed unwanted exceptions from KMFunctionTest
Feb 10, 2021
83cff35
Merge pull request #3 from BKSSMVenkateswarlu/remove_public_operations
mdwivedi Feb 10, 2021
7f510db
Merge branch 'master' into move_unsigned_compare
mdwivedi Feb 10, 2021
fd69d5a
Merge pull request #4 from mdwivedi/move_unsigned_compare
mdwivedi Feb 10, 2021
5e0dba3
Revert "Move unsigned compare"
mdwivedi Feb 10, 2021
dcd0ecd
Merge pull request #5 from mdwivedi/revert-4-move_unsigned_compare
mdwivedi Feb 10, 2021
a900964
Moving unsigned compare to KMInteger
Feb 10, 2021
5c1e3bd
Removing error code
Feb 10, 2021
67309ab
code reformatting
Feb 10, 2021
708f99d
Added test unsupported block mode
Feb 11, 2021
0bc51f7
Merge pull request #52 from mdwivedi/master
BKSSMVenkateswarlu Feb 11, 2021
3894d44
Merge pull request #54 from BKSSMVenkateswarlu/remove_public_operations
BKSSMVenkateswarlu Feb 11, 2021
d9b8f3e
Updated KMFunctionalTest
Feb 11, 2021
159a62b
Merge branch 'master' into code_formatting
BKSSMVenkateswarlu Feb 11, 2021
9825c90
Merge pull request #53 from mdwivedi/code_formatting
BKSSMVenkateswarlu Feb 11, 2021
087da74
1. return INVALID_KEY_BLOB incase if parEncryptedKeyblob fails for any
Feb 12, 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
106 changes: 55 additions & 51 deletions Applet/AndroidSEProvider/build.xml
Original file line number Diff line number Diff line change
@@ -1,77 +1,81 @@
<project name="AndroidSEProvider" default = "default">
<import file="../build.xml" as="common" />
<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"
<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">
<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}">
<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">
<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"/>
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"/>
<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" />

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

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import javacard.security.AESKey;

public class KMAESKey implements KMMasterKey {

private AESKey aesKey;

public KMAESKey(AESKey key) {
Expand All @@ -35,7 +36,7 @@ public void setKey(byte[] keyData, short kOff) {
public AESKey getKey() {
return aesKey;
}

public short getKeySizeBits() {
return aesKey.getSize();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,20 @@

public class KMAndroidSEApplet extends KMKeymasterApplet implements OnUpgradeListener {

KMAndroidSEApplet(){
super(new KMAndroidSEProvider());
}
/**
* Installs this applet.
*
* @param bArray the array containing installation parameters
* @param bOffset the starting offset in bArray
* @param bLength the length in bytes of the parameter data in bArray
*/
public static void install(byte[] bArray, short bOffset, byte bLength) {
new KMAndroidSEApplet().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
}
KMAndroidSEApplet() {
super(new KMAndroidSEProvider());
}

/**
* Installs this applet.
*
* @param bArray the array containing installation parameters
* @param bOffset the starting offset in bArray
* @param bLength the length in bytes of the parameter data in bArray
*/
public static void install(byte[] bArray, short bOffset, byte bLength) {
new KMAndroidSEApplet().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
}

@Override
public void onCleanup() {
Expand Down Expand Up @@ -66,7 +67,7 @@ public Element onSave() {

// Create element.
Element element = UpgradeManager.createElement(Element.TYPE_SIMPLE,
primitiveCount, objectCount);
primitiveCount, objectCount);
element.write(provisionStatus);
element.write(keymasterState);
repository.onSave(element);
Expand Down
Loading