summaryrefslogtreecommitdiffstats
path: root/base/common/src
diff options
context:
space:
mode:
authorJack Magne <jmagne@dhcp-16-213.sjc.redhat.com>2014-04-25 20:27:09 -0700
committerJack Magne <jmagne@dhcp-16-213.sjc.redhat.com>2014-04-30 20:06:28 -0700
commit8084199ce991d44023cbd1515d735c795100c911 (patch)
tree135f40de0d9a93b7b1d42b633214b58e41df6740 /base/common/src
parent8168b0d7d8b6a2d4929d8470ff9d2845d76e724d (diff)
downloadpki-8084199ce991d44023cbd1515d735c795100c911.tar.gz
pki-8084199ce991d44023cbd1515d735c795100c911.tar.xz
pki-8084199ce991d44023cbd1515d735c795100c911.zip
Support for Applet Upgrade and Format.
The following changes have been done: 1. Applet Upgrade for real token. The applet is written and an instance of applet created. 2. 95% of the format operation done. This includes proper status update progreass bar for esc and writing the phone home url to the token. Once this operation is complete, the token can be entered into esc and esc will be able to phone home and point to TPS for further operations such as enrollment and pin reset when they are implemented. 3. The phoneHome xml file changed slightly to prevent esc from reading exttraneous line feeds when phoning home. 4. The CS.cfg has been changed to correctly reflect the phone home url we want to write to the token. The following to be done to fully finish format, later tickets. 1.Updating the tokendb with tne newly formatted token. Future ticket. 2.Revoking tokens current certificates, if any. Future ticket. 3.Symmetric Key changeover. Future ticket.
Diffstat (limited to 'base/common/src')
-rw-r--r--base/common/src/org/dogtagpki/tps/apdu/InstallLoadAPDU.java8
-rw-r--r--base/common/src/org/dogtagpki/tps/main/TPSBuffer.java5
-rw-r--r--base/common/src/org/dogtagpki/tps/msg/TPSMessage.java11
3 files changed, 21 insertions, 3 deletions
diff --git a/base/common/src/org/dogtagpki/tps/apdu/InstallLoadAPDU.java b/base/common/src/org/dogtagpki/tps/apdu/InstallLoadAPDU.java
index cb84b9382..d754801dc 100644
--- a/base/common/src/org/dogtagpki/tps/apdu/InstallLoadAPDU.java
+++ b/base/common/src/org/dogtagpki/tps/apdu/InstallLoadAPDU.java
@@ -45,9 +45,11 @@ public class InstallLoadAPDU extends APDU {
inputData.add((byte) 0x04);
inputData.add((byte) 0xC6);
inputData.add((byte) 0x02);
- fileLen += 24 + sdAID.size();
- inputData.add((byte) ((fileLen >> 8) & 0xff));
- inputData.add((byte) (fileLen & 0xff));
+ int finalLen = fileLen + 24 + sdAID.size();
+
+ inputData.add((byte) ((finalLen >> 8) & 0xff));
+ inputData.add((byte) (finalLen & 0xff));
+ inputData.add((byte) 0x0);
setData(inputData);
}
diff --git a/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java b/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
index 03ec46092..ef40a3a36 100644
--- a/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
+++ b/base/common/src/org/dogtagpki/tps/main/TPSBuffer.java
@@ -300,6 +300,11 @@ public class TPSBuffer {
TPSBuffer b6 = new TPSBuffer("A0000000030000");
b6.dump();
+ TPSBuffer empty = new TPSBuffer();
+
+ int emptySize = empty.size();
+ System.out.println("empty buffer size: " + emptySize);
+
}
}
diff --git a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
index 036c44c36..c6e7cf7a7 100644
--- a/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
+++ b/base/common/src/org/dogtagpki/tps/msg/TPSMessage.java
@@ -85,6 +85,7 @@ public class TPSMessage {
public static final String INFO_NAME = "next_task_name";
public static final String REQUIRED_PARAMETER_NAME = "required_parameter";
public static final String PARAMETER_NAME = "parameter";
+ public static final String STATUS_UPDATE_EXTENSION_NAME = "statusUpdate";
private Map<String, String> map = new LinkedHashMap<String, String>();
@@ -466,6 +467,12 @@ public class TPSMessage {
case MSG_STATUS_UPDATE_REQUEST:
break;
case MSG_STATUS_UPDATE_RESPONSE:
+
+ String statusValue = get(TPSMessage.STATUS_NAME);
+ CMS.debug("statusValue: " + statusValue);
+ int statusInt = Integer.parseInt(statusValue);
+ CMS.debug("statusInt: " + statusInt);
+ result = new StatusUpdateResponse(statusInt);
break;
case MSG_TOKEN_PDU_REQUEST:
break;
@@ -474,6 +481,10 @@ public class TPSMessage {
break;
default:
//Something was garbled with the message coming in
+ throw new IOException("TPSMessage.createMessage: Can't locate incoming TPS message!");
+ }
+
+ if(result == null) {
throw new IOException("TPSMessage.createMessage: Can't create incoming TPS message!");
}