Commit 8cfdaad1 authored by Josh Ji's avatar Josh Ji

correct the arrayCopying of hmac in getHMAC(), rename aesRawKey as hashedSharedSecret

parent 2a5c69e0
// converted by version [v3.0.5]
// on Tue Jun 14 11:42:39 CST 2022
// on Sat Jun 18 22:52:05 CST 2022
.package com/josh/vku2f {
.aid 0xA0:0x0:0x0:0x6:0x47;
......@@ -173,77 +173,77 @@
// 76
instanceFieldRef byte[] IDSecret/RxRp;
// 77
instanceFieldRef byte[] IDSecret/aesRawKey;
instanceFieldRef byte[] IDSecret/hashedSharedSecret;
// 78
instanceFieldRef byte[] IDSecret/Cx;
// 79
instanceFieldRef byte[] IDSecret/IV_ZERO_AES;
instanceFieldRef byte[] IDSecret/hashedIDxAndCx;
// 80
instanceFieldRef short IDSecret/SCRATCH_LENGTH;
instanceFieldRef byte[] IDSecret/IV_ZERO_AES;
// 81
instanceFieldRef byte IDSecret/i;
instanceFieldRef short IDSecret/SCRATCH_LENGTH;
// 82
instanceFieldRef 1.20 IDSecret/aesKey;
instanceFieldRef byte IDSecret/i;
// 83
instanceFieldRef 4.1 IDSecret/aesEncrypt;
instanceFieldRef 1.20 IDSecret/aesKey;
// 84
instanceFieldRef 4.1 IDSecret/aesDecrypt;
instanceFieldRef 4.1 IDSecret/aesEncrypt;
// 85
instanceFieldRef 1.11 IDSecret/sha256;
instanceFieldRef 4.1 IDSecret/aesDecrypt;
// 86
instanceFieldRef byte[] IDSecret/scratch;
instanceFieldRef 1.11 IDSecret/sha256;
// 87
instanceFieldRef 1.16 PinUvAuthProtocolOne/ecDhKeyPair;
instanceFieldRef byte[] IDSecret/scratch;
// 88
instanceFieldRef boolean[] PinUvAuthProtocolOne/ecDhSet;
instanceFieldRef 1.16 PinUvAuthProtocolOne/ecDhKeyPair;
// 89
instanceFieldRef byte PinUvAuthToken/permissionsRPID;
instanceFieldRef boolean[] PinUvAuthProtocolOne/ecDhSet;
// 90
instanceFieldRef byte PinUvAuthToken/permissionsSet;
instanceFieldRef byte PinUvAuthToken/permissionsRPID;
// 91
instanceFieldRef byte PinUvAuthToken/usageTimer;
instanceFieldRef byte PinUvAuthToken/permissionsSet;
// 92
instanceFieldRef boolean PinUvAuthToken/inUseFlag;
instanceFieldRef byte PinUvAuthToken/usageTimer;
// 93
instanceFieldRef byte PinUvAuthToken/initialUsageTimeLimit;
instanceFieldRef boolean PinUvAuthToken/inUseFlag;
// 94
instanceFieldRef byte PinUvAuthToken/userPresentTimeLimit;
instanceFieldRef byte PinUvAuthToken/initialUsageTimeLimit;
// 95
instanceFieldRef byte PinUvAuthToken/maxUsageTimePeriod;
instanceFieldRef byte PinUvAuthToken/userPresentTimeLimit;
// 96
instanceFieldRef boolean PinUvAuthToken/userVerifiedFlag;
instanceFieldRef byte PinUvAuthToken/maxUsageTimePeriod;
// 97
instanceFieldRef boolean PinUvAuthToken/userPresentFlag;
instanceFieldRef boolean PinUvAuthToken/userVerifiedFlag;
// 98
instanceFieldRef byte[] PublicKeyCredentialDescriptor/type;
instanceFieldRef boolean PinUvAuthToken/userPresentFlag;
// 99
instanceFieldRef DomString PublicKeyCredentialEntity/name;
instanceFieldRef byte[] PublicKeyCredentialDescriptor/type;
// 100
instanceFieldRef short[] PublicKeyCredentialParams/paramList;
instanceFieldRef DomString PublicKeyCredentialEntity/name;
// 101
instanceFieldRef short PublicKeyCredentialParams/listIndex;
instanceFieldRef short[] PublicKeyCredentialParams/paramList;
// 102
instanceFieldRef DomString PublicKeyCredentialRpEntity/rpId;
instanceFieldRef short PublicKeyCredentialParams/listIndex;
// 103
instanceFieldRef boolean[] PublicKeyCredentialUserEntity/dataPresent;
instanceFieldRef DomString PublicKeyCredentialRpEntity/rpId;
// 104
instanceFieldRef byte[] StoredCredential/signingCounter;
instanceFieldRef boolean[] PublicKeyCredentialUserEntity/dataPresent;
// 105
instanceFieldRef boolean StoredCredential/initialised;
instanceFieldRef byte[] StoredCredential/signingCounter;
// 106
instanceFieldRef boolean StoredCredential/hmacEnabled;
instanceFieldRef boolean StoredCredential/initialised;
// 107
instanceFieldRef byte[] StoredCredential/credRandom;
instanceFieldRef boolean StoredCredential/hmacEnabled;
// 108
instanceFieldRef 1.16 StoredCredential/keyPair;
instanceFieldRef byte[] StoredCredential/credRandom;
// 109
instanceFieldRef 1.15 StoredES256Credential/sig;
instanceFieldRef 1.16 StoredCredential/keyPair;
// 110
instanceFieldRef 1.15 StoredPS256Credential/kpSignature;
instanceFieldRef 1.15 StoredES256Credential/sig;
// 111
instanceFieldRef 4.1 StoredRS256Credential/kpSignature;
instanceFieldRef 1.15 StoredPS256Credential/kpSignature;
// 112
staticMethodRef 2.8.13(SB)[B; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
instanceFieldRef 4.1 StoredRS256Credential/kpSignature;
// 113
.classRef CBOREncoder;
// 114
......@@ -709,29 +709,29 @@
// 310
virtualMethodRef CBORBase/getCurrentOffset()S;
// 311
staticFieldRef byte[] Utf8Strings/UTF8_NULL;
virtualMethodRef CBORDecoder/readRawByte()B;
// 312
staticFieldRef byte[] Utf8Strings/UTF8_NULL;
// 313
staticMethodRef Random/getInstance()Ljavacard/security/RandomData;;
.descriptor Ljavacard/security/RandomData; 1.14;
// 313
virtualMethodRef 1.14.3([BSS)S; // nextBytes([BSS)S
// 314
staticMethodRef 2.16.7([BSSB)S; // javacard/framework/Util.arrayFill([BSSB)S
virtualMethodRef 1.14.3([BSS)S; // nextBytes([BSS)S
// 315
staticMethodRef 2.16.7([BSSB)S; // javacard/framework/Util.arrayFill([BSSB)S
// 316
staticMethodRef 1.13.0(BSZ)Ljavacard/security/Key;; // javacard/security/KeyBuilder.buildKey(BSZ)Ljavacard/security/Key;
.descriptor Ljavacard/security/Key; 1.0;
// 316
.classRef 1.20; // javacard/security/AESKey
// 317
virtualMethodRef CBORDecoder/readRawByte()B;
.classRef 1.20; // javacard/security/AESKey
// 318
virtualMethodRef CBORBase/getBuffer()[B;
// 319
staticMethodRef 4.1.0(BZ)Ljavacardx/crypto/Cipher;; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
.descriptor Ljavacardx/crypto/Cipher; 4.1;
// 319
virtualMethodRef CBORBase/getBuffer()[B;
// 320
virtualMethodRef CBORBase/getCurrentOffsetAndIncrease(S)S;
// 321
......@@ -739,42 +739,42 @@
// 322
staticMethodRef 2.16.2([BS[BSS)S; // javacard/framework/Util.arrayCopyNonAtomic([BS[BSS)S
// 323
virtualMethodRef CBORDecoder/readInt16()S;
// 324
virtualMethodRef 4.1.4(Ljavacard/security/Key;B[BSS)V; // init(Ljavacard/security/Key;B[BSS)V
.descriptor Ljavacard/security/Key; 1.0;
// 324
virtualMethodRef 4.1.1([BSS[BS)S; // doFinal([BSS[BS)S
// 325
virtualMethodRef 1.11.5([BSS)V; // update([BSS)V
virtualMethodRef 4.1.1([BSS[BS)S; // doFinal([BSS[BS)S
// 326
virtualMethodRef 4.1.5([BSS[BS)S; // update([BSS[BS)S
virtualMethodRef 1.11.5([BSS)V; // update([BSS)V
// 327
virtualMethodRef IDSecret/getRxRp()[B;
virtualMethodRef 4.1.5([BSS[BS)S; // update([BSS[BS)S
// 328
staticFieldRef byte[] KeyParams/secp256r1p;
virtualMethodRef IDSecret/getRxRp()[B;
// 329
staticFieldRef byte[] KeyParams/secp256r1A;
staticFieldRef byte[] KeyParams/secp256r1p;
// 330
staticFieldRef byte[] KeyParams/secp256r1B;
staticFieldRef byte[] KeyParams/secp256r1A;
// 331
staticFieldRef byte[] KeyParams/secp256r1G;
staticFieldRef byte[] KeyParams/secp256r1B;
// 332
staticFieldRef byte[] KeyParams/secp256r1R;
staticFieldRef byte[] KeyParams/secp256r1G;
// 333
staticMethodRef PinUvAuthProtocol/<init>()V;
staticFieldRef byte[] KeyParams/secp256r1R;
// 334
staticMethodRef PinUvAuthProtocol/<init>()V;
// 335
staticMethodRef 1.16.1(Ljavacard/security/PublicKey;Ljavacard/security/PrivateKey;)V; // javacard/security/KeyPair.<init>(Ljavacard/security/PublicKey;Ljavacard/security/PrivateKey;)V
.descriptor Ljavacard/security/PublicKey; 1.3;
.descriptor Ljavacard/security/PrivateKey; 1.2;
// 335
virtualMethodRef CBORDecoder/readInt16()S;
// 336
virtualMethodRef CBORDecoder/readRawByteArray([BSS)S;
// 337
virtualMethodRef PinUvAuthToken/resetTokenState()V;
// 338
virtualMethodRef CBORBase/getBufferLength()S;
// 338
virtualMethodRef PinUvAuthToken/resetTokenState()V;
// 339
staticMethodRef ICUtil/isLessThanAsUnsignedShort(SS)Z;
// 340
......@@ -800,27 +800,27 @@
// 350
virtualMethodRef CBORBase/getCurrentOffsetAndIncrease(S)S;
// 351
staticMethodRef PublicKeyCredentialEntity/<init>()V;
// 352
staticMethodRef CBOREncoder/writeRawByteArray([BSS)S;
// 352
staticMethodRef PublicKeyCredentialEntity/<init>()V;
// 353
virtualMethodRef DomString/checkEquals(Lcom/josh/vku2f/DomString;)Z;
// 354
staticMethodRef 2.16.1([BS[BSS)S; // javacard/framework/Util.arrayCopy([BS[BSS)S
// 354
virtualMethodRef DomString/checkEquals(Lcom/josh/vku2f/DomString;)Z;
// 355
.classRef 0.5; // java/lang/ArrayIndexOutOfBoundsException
staticMethodRef 2.3.0()V; // javacard/framework/Applet.<init>()V
// 356
staticFieldRef 1.14 Random/rng;
.classRef 0.5; // java/lang/ArrayIndexOutOfBoundsException
// 357
staticFieldRef 1.14 Random/rng;
// 358
staticMethodRef 1.14.0(B)Ljavacard/security/RandomData;; // javacard/security/RandomData.getInstance(B)Ljavacard/security/RandomData;
.descriptor Ljavacard/security/RandomData; 1.14;
// 358
staticFieldRef 1.14 StoredCredential/randomData;
// 359
virtualMethodRef 1.14.1([BSS)V; // generateData([BSS)V
staticFieldRef 1.14 StoredCredential/randomData;
// 360
staticMethodRef 2.3.0()V; // javacard/framework/Applet.<init>()V
virtualMethodRef 1.14.1([BSS)V; // generateData([BSS)V
// 361
.classRef 1.19; // javacard/security/ECPublicKey
// 362
......@@ -828,42 +828,44 @@
// 363
staticMethodRef 2.8.15(SB)[S; // javacard/framework/JCSystem.makeTransientShortArray(SB)[S
// 364
staticMethodRef 2.16.3([BSSB)S; // javacard/framework/Util.arrayFillNonAtomic([BSSB)S
// 365
staticMethodRef StoredCredential/<init>()V;
// 366
virtualMethodRef 1.16.3()Ljavacard/security/PublicKey;; // getPublic()Ljavacard/security/PublicKey;
.descriptor Ljavacard/security/PublicKey; 1.3;
// 365
staticMethodRef 2.16.3([BSSB)S; // javacard/framework/Util.arrayFillNonAtomic([BSSB)S
// 366
staticMethodRef StoredCredential/<init>()V;
// 367
virtualMethodRef AuthenticatorMakeCredential/getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;;
virtualMethodRef CBORDecoder/readMajorType(B)S;
// 368
virtualMethodRef AuthenticatorMakeCredential/getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;;
virtualMethodRef AuthenticatorMakeCredential/getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;;
// 369
virtualMethodRef CBORDecoder/readMajorType(B)S;
virtualMethodRef AuthenticatorMakeCredential/getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;;
// 370
virtualMethodRef StoredCredential/incrementCounter()V;
.classRef CBORDecoder;
// 371
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
virtualMethodRef StoredCredential/incrementCounter()V;
// 372
.classRef CBORDecoder;
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
// 373
virtualMethodRef StoredCredential/incrementCounter()V;
staticMethodRef CBORDecoder/<init>()V;
// 374
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
virtualMethodRef StoredCredential/incrementCounter()V;
// 375
.classRef 1.9; // javacard/security/RSAPublicKey
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
// 376
staticMethodRef CBORDecoder/<init>()V;
.classRef 1.9; // javacard/security/RSAPublicKey
// 377
staticMethodRef 2.8.13(SB)[B; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
// 378
virtualMethodRef 4.1.3(Ljavacard/security/Key;B)V; // init(Ljavacard/security/Key;B)V
.descriptor Ljavacard/security/Key; 1.0;
// 378
virtualMethodRef StoredCredential/incrementCounter()V;
// 379
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
virtualMethodRef StoredCredential/incrementCounter()V;
// 380
virtualMethodRef StoredCredential/doAttestationCommon([BS)V;
// 381
virtualMethodRef CBOREncoder/encodeNegativeUInt16(S)S;
}
......@@ -904,7 +906,7 @@
invokespecial 292; // javacard/security/KeyPair.<init>(BS)V
putfield_a 0; // reference com/josh/vku2f/AttestationKeyPair.kp
getfield_a_this 0; // reference com/josh/vku2f/AttestationKeyPair.kp
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 120; // T_CLASSORINTERFACE javacard/security/ECKey
invokestatic 124; // com/josh/vku2f/KeyParams.sec256r1params(Ljavacard/security/ECKey;)V
getfield_a_this 0; // reference com/josh/vku2f/AttestationKeyPair.kp
......@@ -963,7 +965,7 @@
getfield_a_this 2; // reference com/josh/vku2f/AttestationKeyPair.x509cert
sconst_0;
sload_3;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
return;
}
......@@ -978,7 +980,7 @@
sload_2;
getfield_a_this 2; // reference com/josh/vku2f/AttestationKeyPair.x509cert
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 2; // reference com/josh/vku2f/AttestationKeyPair.x509cert
arraylength;
......@@ -1002,7 +1004,7 @@
.locals 0;
L0: getfield_a_this 0; // reference com/josh/vku2f/AttestationKeyPair.kp
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 361; // T_CLASSORINTERFACE javacard/security/ECPublicKey
aload_1;
sload_2;
......@@ -1072,11 +1074,11 @@
sconst_0;
aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sastore;
L5: bspush 64;
sconst_1;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
astore_3;
L6: goto L8;
L7: astore 4;
......@@ -1123,7 +1125,7 @@
aload_2;
sconst_3;
saload;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
goto_w L38;
L12: aload_2;
......@@ -1146,14 +1148,14 @@
aload_2;
sconst_3;
saload;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
goto_w L38;
L13: aload_2;
sconst_3;
aload_1;
sconst_4;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sastore;
aload_0;
aload_2;
......@@ -1175,7 +1177,7 @@
sconst_3;
aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sastore;
aload_2;
sconst_3;
......@@ -1265,7 +1267,7 @@
sconst_3;
aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sastore;
aload_2;
sconst_4;
......@@ -1366,7 +1368,7 @@
sload_2;
getfield_a_this 6; // reference com/josh/vku2f/AuthenticatorGetAssertion.clientDataHash
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 6; // reference com/josh/vku2f/AuthenticatorGetAssertion.clientDataHash
arraylength;
......@@ -1435,7 +1437,7 @@
astore_2;
L4: bspush 64;
sconst_2;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
astore_3;
L5: goto L7;
L6: astore 4;
......@@ -1444,7 +1446,7 @@
astore_3;
L7: bspush 64;
sconst_2;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
astore 4;
L8: goto L10;
L9: astore 5;
......@@ -1453,7 +1455,7 @@
astore 4;
L10: aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 5;
getfield_a_this 8; // reference com/josh/vku2f/AuthenticatorMakeCredential.options
sconst_0;
......@@ -1487,7 +1489,7 @@
getfield_a_this 9; // reference com/josh/vku2f/AuthenticatorMakeCredential.dataHash
sconst_0;
sload 8;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
goto_w L92;
L14: aload_0;
......@@ -1497,7 +1499,7 @@
putfield_a 10; // reference com/josh/vku2f/AuthenticatorMakeCredential.rp
aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 8;
sload 8;
sconst_2;
......@@ -1557,7 +1559,7 @@
putfield_a 11; // reference com/josh/vku2f/AuthenticatorMakeCredential.user
aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 8;
sconst_0;
sstore 9;
......@@ -1646,7 +1648,7 @@
L36: goto_w L92;
L37: aload_1;
sconst_4;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 8;
aload_0;
new 276; // com/josh/vku2f/PublicKeyCredentialParams
......@@ -1661,7 +1663,7 @@
if_scmpge_w L60;
L39: aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 10;
sload 10;
sconst_2;
......@@ -1781,7 +1783,7 @@
L60: goto_w L92;
L61: aload_1;
sconst_4;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 8;
aload_0;
sload 8;
......@@ -1794,7 +1796,7 @@
if_scmpge L74;
L63: aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 10;
sload 10;
sconst_2;
......@@ -1863,7 +1865,7 @@
goto L92;
L77: aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore 8;
sconst_0;
sstore 9;
......@@ -2010,7 +2012,7 @@
sload_2;
getfield_a_this 9; // reference com/josh/vku2f/AuthenticatorMakeCredential.dataHash
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 9; // reference com/josh/vku2f/AuthenticatorMakeCredential.dataHash
arraylength;
......@@ -2394,7 +2396,7 @@
.locals 1;
L0: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
bspush 31;
sand;
sstore_1;
......@@ -2407,7 +2409,7 @@
bspush 24;
if_scmpne L4;
L3: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
sspush 255;
sand;
s2b;
......@@ -2423,7 +2425,7 @@
.locals 1;
L0: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
bspush 31;
sand;
sstore_1;
......@@ -2431,7 +2433,7 @@
bspush 25;
if_scmpne L2;
L1: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
aload_0;
sconst_2;
invokevirtual 320; // getCurrentOffsetAndIncrease(S)S
......@@ -2448,7 +2450,7 @@
.locals 1;
L0: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
bspush 31;
sand;
sstore_3;
......@@ -2456,7 +2458,7 @@
bspush 26;
if_scmpne L2;
L1: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
aload_0;
sconst_4;
invokevirtual 320; // getCurrentOffsetAndIncrease(S)S
......@@ -2476,7 +2478,7 @@
.locals 1;
L0: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
bspush 31;
sand;
sstore_3;
......@@ -2484,7 +2486,7 @@
bspush 27;
if_scmpne L2;
L1: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
aload_0;
bspush 8;
invokevirtual 320; // getCurrentOffsetAndIncrease(S)S
......@@ -2516,7 +2518,7 @@
bastore;
goto L3;
L2: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
aload_0;
sconst_1;
sload_3;
......@@ -2555,7 +2557,7 @@
sconst_2;
if_scmpne L4;
L3: aload_0;
invokevirtual 335; // readInt16()S
invokevirtual 323; // readInt16()S
sstore_2;
goto L5;
L4: sspush 27012;
......@@ -2569,7 +2571,7 @@
.locals 1;
L0: aload_0;
invokevirtual 317; // readRawByte()B
invokevirtual 311; // readRawByte()B
sstore_1;
sload_1;
bspush -11;
......@@ -2646,12 +2648,12 @@
invokevirtual 310; // getCurrentOffset()S
sadd;
aload_0;
invokevirtual 338; // getBufferLength()S
invokevirtual 337; // getBufferLength()S
if_scmple L3;
L2: sspush 26368;
invokestatic 299; // javacard/framework/ISOException.throwIt(S)V
L3: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
aload_0;
invokevirtual 310; // getCurrentOffset()S
aload_1;
......@@ -2672,7 +2674,7 @@
.locals 0;
L0: aload_0;
invokevirtual 319; // getBuffer()[B
invokevirtual 318; // getBuffer()[B
getfield_a_this 15; // reference com/josh/vku2f/CBORBase.mStatusWords
sconst_0;
dup2;
......@@ -2945,7 +2947,7 @@
aload_1;
sload_2;
sload_3;
invokespecial 352; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
invokespecial 351; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
sadd;
sstore 4;
sload 4;
......@@ -2966,7 +2968,7 @@
aload_1;
sload_2;
sload_3;
invokespecial 352; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
invokespecial 351; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
sadd;
sstore 4;
sload 4;
......@@ -3033,7 +3035,7 @@
aload_1;
sload_2;
sconst_4;
invokespecial 352; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
invokespecial 351; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
sconst_1;
sadd;
sreturn;
......@@ -3051,7 +3053,7 @@
aload_1;
sload_2;
bspush 8;
invokespecial 352; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
invokespecial 351; // com/josh/vku2f/CBOREncoder.writeRawByteArray([BSS)S
sconst_1;
sadd;
sreturn;
......@@ -3215,7 +3217,7 @@
.locals 2;
L0: aload_0;
invokespecial 360; // javacard/framework/Applet.<init>()V
invokespecial 355; // javacard/framework/Applet.<init>()V
bspush 8;
putfield_b_this 17; // byte com/josh/vku2f/CTAP2.MAX_PIN_RETRIES
bspush 8;
......@@ -3223,7 +3225,7 @@
L1: aload_0;
sspush 1210;
sconst_2;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
putfield_a 19; // reference com/josh/vku2f/CTAP2.dataBuffer
L2: goto L4;
L3: astore_1;
......@@ -3234,7 +3236,7 @@
L4: aload_0;
sspush 512;
sconst_2;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
putfield_a 20; // reference com/josh/vku2f/CTAP2.scratch
L5: goto L7;
L6: astore_1;
......@@ -3248,9 +3250,9 @@
invokestatic 363; // javacard/framework/JCSystem.makeTransientShortArray(SB)[S
putfield_a 21; // reference com/josh/vku2f/CTAP2.tempVars
aload_0;
new 372; // com/josh/vku2f/CBORDecoder
new 370; // com/josh/vku2f/CBORDecoder
dup;
invokespecial 376; // com/josh/vku2f/CBORDecoder.<init>()V
invokespecial 373; // com/josh/vku2f/CBORDecoder.<init>()V
putfield_a 22; // reference com/josh/vku2f/CTAP2.cborDecoder
aload_0;
new 113; // com/josh/vku2f/CBOREncoder
......@@ -3854,7 +3856,7 @@
sload_2;
sconst_1;
ssub;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 34; // reference com/josh/vku2f/CTAP2.idSecret
new 184; // com/josh/vku2f/DomString
......@@ -3933,7 +3935,7 @@
invokevirtual 193; // init([BSS)V
L1: getfield_a_this 22; // reference com/josh/vku2f/CTAP2.cborDecoder
sconst_4;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
pop;
getfield_a_this 22; // reference com/josh/vku2f/CTAP2.cborDecoder
getfield_a_this 20; // reference com/josh/vku2f/CTAP2.scratch
......@@ -3958,7 +3960,7 @@
getfield_a 39; // reference com/josh/vku2f/IDSecret.PuKp
sconst_1;
bspush 64;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
L2: goto L4;
L3: astore_3;
......@@ -4093,7 +4095,7 @@
sload_2;
sconst_1;
ssub;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 19; // reference com/josh/vku2f/CTAP2.dataBuffer
sconst_0;
......@@ -5287,7 +5289,7 @@
sconst_0;
getfield_a_this 23; // reference com/josh/vku2f/CTAP2.cborEncoder
invokevirtual 345; // getCurrentOffset()S
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
invokestatic 268; // javacard/framework/JCSystem.commitTransaction()V
L2: getfield_a_this 50; // reference com/josh/vku2f/CTAP2.fidoInfo
......@@ -6061,7 +6063,7 @@
L0: aload_1;
sconst_5;
invokevirtual 369; // readMajorType(B)S
invokevirtual 367; // readMajorType(B)S
sstore_2;
L1: aload_1;
invokevirtual 115; // readInt8()B
......@@ -6609,7 +6611,7 @@
getfield_a_this 54; // reference com/josh/vku2f/DomString.str
sconst_0;
sload_2;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
sload_2;
putfield_s_this 55; // short com/josh/vku2f/DomString.len
......@@ -6888,19 +6890,20 @@
public final byte[] Rp 2; // [B
public final byte[] PuKp 3; // [B
public final byte[] sharedSecret 4; // [B
public final byte[] aesRawKey 5; // [B
public final byte[] hashedSharedSecret 5; // [B
public final byte[] Cx 6; // [B
public final byte[] encryptedCx 7; // [B
public final byte[] hmac 8; // [B
private final byte[] RxRp 9; // [B
private 1.20 aesKey 10; // Ljavacard/security/AESKey;
private 4.1 aesEncrypt 11; // Ljavacardx/crypto/Cipher;
private 4.1 aesDecrypt 12; // Ljavacardx/crypto/Cipher;
private final byte[] IV_ZERO_AES 13; // [B
private 1.11 sha256 14; // Ljavacard/security/MessageDigest;
private byte[] scratch 15; // [B
private final short SCRATCH_LENGTH 16; // S
private byte i 17; // B
public final byte[] hashedIDxAndCx 9; // [B
private final byte[] RxRp 10; // [B
private 1.20 aesKey 11; // Ljavacard/security/AESKey;
private 4.1 aesEncrypt 12; // Ljavacardx/crypto/Cipher;
private 4.1 aesDecrypt 13; // Ljavacardx/crypto/Cipher;
private final byte[] IV_ZERO_AES 14; // [B
private 1.11 sha256 15; // Ljavacard/security/MessageDigest;
private byte[] scratch 16; // [B
private final short SCRATCH_LENGTH 17; // S
private byte i 18; // B
}
.publicMethodTable 1 {
......@@ -6944,7 +6947,7 @@
aload_0;
bspush 32;
newarray 11;
putfield_a 77; // reference com/josh/vku2f/IDSecret.aesRawKey
putfield_a 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
aload_0;
bspush 16;
newarray 11;
......@@ -6958,6 +6961,10 @@
newarray 11;
putfield_a 43; // reference com/josh/vku2f/IDSecret.hmac
aload_0;
bspush 32;
newarray 11;
putfield_a 79; // reference com/josh/vku2f/IDSecret.hashedIDxAndCx
aload_0;
bspush 16;
newarray 11;
dup;
......@@ -7024,25 +7031,25 @@
bspush 15;
sconst_0;
bastore;
putfield_a 79; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
putfield_a 80; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
sspush 128;
putfield_s_this 80; // short com/josh/vku2f/IDSecret.SCRATCH_LENGTH
putfield_s_this 81; // short com/josh/vku2f/IDSecret.SCRATCH_LENGTH
sconst_0;
putfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
putfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
aload_0;
new 184; // com/josh/vku2f/DomString
dup;
getstatic_a 311; // reference com/josh/vku2f/Utf8Strings.UTF8_NULL
getstatic_a 311; // reference com/josh/vku2f/Utf8Strings.UTF8_NULL
getstatic_a 312; // reference com/josh/vku2f/Utf8Strings.UTF8_NULL
getstatic_a 312; // reference com/josh/vku2f/Utf8Strings.UTF8_NULL
arraylength;
invokespecial 185; // com/josh/vku2f/DomString.<init>([BS)V
putfield_a 37; // reference com/josh/vku2f/IDSecret.IDx
invokestatic 312; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
invokestatic 313; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
getfield_a_this 38; // reference com/josh/vku2f/IDSecret.Rx
sconst_0;
getfield_a_this 38; // reference com/josh/vku2f/IDSecret.Rx
arraylength;
invokevirtual 313; // nextBytes([BSS)S
invokevirtual 314; // nextBytes([BSS)S
pop;
getfield_a_this 75; // reference com/josh/vku2f/IDSecret.Rp
sconst_0;
......@@ -7050,7 +7057,7 @@
getfield_a_this 75; // reference com/josh/vku2f/IDSecret.Rp
arraylength;
s2b;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
getfield_a_this 76; // reference com/josh/vku2f/IDSecret.RxRp
sconst_0;
......@@ -7058,7 +7065,7 @@
getfield_a_this 76; // reference com/josh/vku2f/IDSecret.RxRp
arraylength;
s2b;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
getfield_a_this 39; // reference com/josh/vku2f/IDSecret.PuKp
sconst_0;
......@@ -7072,7 +7079,7 @@
ssub;
s2b;
sconst_0;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
getfield_a_this 40; // reference com/josh/vku2f/IDSecret.sharedSecret
sconst_0;
......@@ -7080,22 +7087,22 @@
arraylength;
s2b;
sconst_0;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
sconst_0;
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
arraylength;
s2b;
sconst_0;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
invokestatic 312; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
invokestatic 313; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
sconst_0;
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
arraylength;
invokevirtual 313; // nextBytes([BSS)S
invokevirtual 314; // nextBytes([BSS)S
pop;
getfield_a_this 41; // reference com/josh/vku2f/IDSecret.encryptedCx
sconst_0;
......@@ -7103,7 +7110,7 @@
arraylength;
s2b;
sconst_0;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
getfield_a_this 43; // reference com/josh/vku2f/IDSecret.hmac
sconst_0;
......@@ -7111,35 +7118,35 @@
arraylength;
s2b;
sconst_0;
invokestatic 314; // javacard/framework/Util.arrayFill([BSSB)S
invokestatic 315; // javacard/framework/Util.arrayFill([BSSB)S
pop;
aload_0;
bspush 15;
sspush 256;
sconst_0;
invokestatic 315; // javacard/security/KeyBuilder.buildKey(BSZ)Ljavacard/security/Key;
checkcast 0 316; // T_CLASSORINTERFACE javacard/security/AESKey
putfield_a 82; // reference com/josh/vku2f/IDSecret.aesKey
invokestatic 316; // javacard/security/KeyBuilder.buildKey(BSZ)Ljavacard/security/Key;
checkcast 0 317; // T_CLASSORINTERFACE javacard/security/AESKey
putfield_a 83; // reference com/josh/vku2f/IDSecret.aesKey
aload_0;
bspush 13;
sconst_0;
invokestatic 318; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 83; // reference com/josh/vku2f/IDSecret.aesEncrypt
invokestatic 319; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 84; // reference com/josh/vku2f/IDSecret.aesEncrypt
aload_0;
bspush 13;
sconst_0;
invokestatic 318; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 84; // reference com/josh/vku2f/IDSecret.aesDecrypt
invokestatic 319; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 85; // reference com/josh/vku2f/IDSecret.aesDecrypt
aload_0;
sconst_4;
sconst_0;
invokestatic 119; // javacard/security/MessageDigest.getInstance(BZ)Ljavacard/security/MessageDigest;
putfield_a 85; // reference com/josh/vku2f/IDSecret.sha256
putfield_a 86; // reference com/josh/vku2f/IDSecret.sha256
aload_0;
sspush 128;
sconst_2;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
putfield_a 86; // reference com/josh/vku2f/IDSecret.scratch
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
putfield_a 87; // reference com/josh/vku2f/IDSecret.scratch
return;
}
......@@ -7148,27 +7155,27 @@
.locals 0;
L0: sconst_0;
putfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
L1: getfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
putfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
L1: getfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
sconst_4;
if_scmpge L3;
L2: getfield_a_this 76; // reference com/josh/vku2f/IDSecret.RxRp
getfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
getfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
getfield_a_this 38; // reference com/josh/vku2f/IDSecret.Rx
getfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
getfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
baload;
getfield_a_this 75; // reference com/josh/vku2f/IDSecret.Rp
getfield_b_this 81; // byte com/josh/vku2f/IDSecret.i
getfield_b_this 82; // byte com/josh/vku2f/IDSecret.i
baload;
sxor;
bastore;
aload_0;
dup;
getfield_b 81; // byte com/josh/vku2f/IDSecret.i
getfield_b 82; // byte com/josh/vku2f/IDSecret.i
sconst_1;
sadd;
s2b;
putfield_b 81; // byte com/josh/vku2f/IDSecret.i
putfield_b 82; // byte com/josh/vku2f/IDSecret.i
goto L1;
L3: getfield_a_this 76; // reference com/josh/vku2f/IDSecret.RxRp
areturn;
......@@ -7178,34 +7185,34 @@
.stack 6;
.locals 0;
L0: getfield_a_this 85; // reference com/josh/vku2f/IDSecret.sha256
L0: getfield_a_this 86; // reference com/josh/vku2f/IDSecret.sha256
getfield_a_this 40; // reference com/josh/vku2f/IDSecret.sharedSecret
sconst_0;
bspush 20;
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
sconst_0;
invokevirtual 209; // doFinal([BSS[BS)S
pop;
getfield_a_this 82; // reference com/josh/vku2f/IDSecret.aesKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
sconst_0;
invokeinterface 3 316 4; // javacard/security/AESKey
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 82; // reference com/josh/vku2f/IDSecret.aesKey
invokeinterface 3 317 4; // javacard/security/AESKey
getfield_a_this 84; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesKey
sconst_2;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
getfield_a_this 80; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
sconst_0;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
getfield_a_this 80; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
arraylength;
invokevirtual 323; // init(Ljavacard/security/Key;B[BSS)V
getfield_a_this 84; // reference com/josh/vku2f/IDSecret.aesDecrypt
getfield_a_this 82; // reference com/josh/vku2f/IDSecret.aesKey
invokevirtual 324; // init(Ljavacard/security/Key;B[BSS)V
getfield_a_this 85; // reference com/josh/vku2f/IDSecret.aesDecrypt
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesKey
sconst_1;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
getfield_a_this 80; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
sconst_0;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
getfield_a_this 80; // reference com/josh/vku2f/IDSecret.IV_ZERO_AES
arraylength;
invokevirtual 323; // init(Ljavacard/security/Key;B[BSS)V
invokevirtual 324; // init(Ljavacard/security/Key;B[BSS)V
return;
}
......@@ -7213,14 +7220,14 @@
.stack 6;
.locals 0;
L0: getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesEncrypt
L0: getfield_a_this 84; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
sconst_0;
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
arraylength;
getfield_a_this 41; // reference com/josh/vku2f/IDSecret.encryptedCx
sconst_0;
invokevirtual 324; // doFinal([BSS[BS)S
invokevirtual 325; // doFinal([BSS[BS)S
pop;
return;
}
......@@ -7232,22 +7239,22 @@
L0: getfield_a_this 37; // reference com/josh/vku2f/IDSecret.IDx
getfield_a 54; // reference com/josh/vku2f/DomString.str
sconst_0;
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sconst_0;
getfield_a_this 37; // reference com/josh/vku2f/IDSecret.IDx
getfield_a 54; // reference com/josh/vku2f/DomString.str
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
sconst_0;
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 37; // reference com/josh/vku2f/IDSecret.IDx
getfield_a 54; // reference com/josh/vku2f/DomString.str
arraylength;
getfield_a_this 78; // reference com/josh/vku2f/IDSecret.Cx
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 37; // reference com/josh/vku2f/IDSecret.IDx
getfield_a 54; // reference com/josh/vku2f/DomString.str
......@@ -7261,46 +7268,53 @@
L1: sload_3;
bspush 32;
if_scmple L3;
L2: getfield_a_this 85; // reference com/josh/vku2f/IDSecret.sha256
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
L2: getfield_a_this 86; // reference com/josh/vku2f/IDSecret.sha256
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sload 4;
bspush 32;
invokevirtual 325; // update([BSS)V
invokevirtual 326; // update([BSS)V
sinc 3 -32;
sinc 4 32;
goto L1;
L3: getfield_a_this 85; // reference com/josh/vku2f/IDSecret.sha256
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
L3: getfield_a_this 86; // reference com/josh/vku2f/IDSecret.sha256
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sload 4;
sload_3;
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sconst_0;
invokevirtual 209; // doFinal([BSS[BS)S
pop;
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sconst_0;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.hashedIDxAndCx
sconst_0;
bspush 32;
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 84; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
sconst_0;
bspush 16;
aload_1;
sload_2;
invokevirtual 326; // update([BSS[BS)S
invokevirtual 327; // update([BSS[BS)S
pop;
getfield_a_this 83; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
getfield_a_this 84; // reference com/josh/vku2f/IDSecret.aesEncrypt
getfield_a_this 87; // reference com/josh/vku2f/IDSecret.scratch
bspush 16;
bspush 16;
aload_1;
sload_2;
bspush 16;
sadd;
invokevirtual 324; // doFinal([BSS[BS)S
invokevirtual 325; // doFinal([BSS[BS)S
pop;
getfield_a_this 86; // reference com/josh/vku2f/IDSecret.scratch
aload_1;
sconst_0;
getfield_a_this 43; // reference com/josh/vku2f/IDSecret.hmac
sconst_0;
bspush 32;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
return;
}
......@@ -7315,7 +7329,7 @@
sspush 1200;
invokevirtual 187; // init([BSS)V
aload_2;
bspush 10;
bspush 11;
invokevirtual 188; // startArray(S)S
pop;
aload_2;
......@@ -7342,7 +7356,7 @@
pop;
aload_2;
aload_0;
invokevirtual 327; // getRxRp()[B
invokevirtual 328; // getRxRp()[B
sconst_0;
getfield_a_this 76; // reference com/josh/vku2f/IDSecret.RxRp
arraylength;
......@@ -7363,9 +7377,9 @@
invokevirtual 191; // encodeByteString([BSS)S
pop;
aload_2;
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
sconst_0;
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.aesRawKey
getfield_a_this 77; // reference com/josh/vku2f/IDSecret.hashedSharedSecret
arraylength;
invokevirtual 191; // encodeByteString([BSS)S
pop;
......@@ -7391,6 +7405,13 @@
invokevirtual 191; // encodeByteString([BSS)S
pop;
aload_2;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.hashedIDxAndCx
sconst_0;
getfield_a_this 79; // reference com/josh/vku2f/IDSecret.hashedIDxAndCx
arraylength;
invokevirtual 191; // encodeByteString([BSS)S
pop;
aload_2;
invokevirtual 345; // getCurrentOffset()S
sreturn;
}
......@@ -7431,27 +7452,27 @@
.descriptor Ljavacard/security/ECKey; 1.17;
L0: aload_0;
getstatic_a 328; // reference com/josh/vku2f/KeyParams.secp256r1p
getstatic_a 329; // reference com/josh/vku2f/KeyParams.secp256r1p
sconst_0;
bspush 32;
invokeinterface 4 120 0; // javacard/security/ECKey
aload_0;
getstatic_a 329; // reference com/josh/vku2f/KeyParams.secp256r1A
getstatic_a 330; // reference com/josh/vku2f/KeyParams.secp256r1A
sconst_0;
bspush 32;
invokeinterface 4 120 3; // javacard/security/ECKey
aload_0;
getstatic_a 330; // reference com/josh/vku2f/KeyParams.secp256r1B
getstatic_a 331; // reference com/josh/vku2f/KeyParams.secp256r1B
sconst_0;
bspush 32;
invokeinterface 4 120 4; // javacard/security/ECKey
aload_0;
getstatic_a 331; // reference com/josh/vku2f/KeyParams.secp256r1G
getstatic_a 332; // reference com/josh/vku2f/KeyParams.secp256r1G
sconst_0;
bspush 65;
invokeinterface 4 120 5; // javacard/security/ECKey
aload_0;
getstatic_a 332; // reference com/josh/vku2f/KeyParams.secp256r1R
getstatic_a 333; // reference com/josh/vku2f/KeyParams.secp256r1R
sconst_0;
bspush 32;
invokeinterface 4 120 6; // javacard/security/ECKey
......@@ -7544,7 +7565,7 @@
.locals 0;
L0: aload_0;
invokespecial 333; // com/josh/vku2f/PinUvAuthProtocol.<init>()V
invokespecial 334; // com/josh/vku2f/PinUvAuthProtocol.<init>()V
return;
}
......@@ -7571,13 +7592,13 @@
dup;
aload_1;
aload_2;
invokespecial 334; // javacard/security/KeyPair.<init>(Ljavacard/security/PublicKey;Ljavacard/security/PrivateKey;)V
putfield_a 87; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokespecial 335; // javacard/security/KeyPair.<init>(Ljavacard/security/PublicKey;Ljavacard/security/PrivateKey;)V
putfield_a 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
aload_0;
sconst_1;
sconst_1;
invokestatic 126; // javacard/framework/JCSystem.makeTransientBooleanArray(SB)[Z
putfield_a 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
putfield_a 89; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
return;
}
......@@ -7601,29 +7622,29 @@
L0: bspush 65;
sconst_1;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
astore_1;
L1: goto L3;
L2: astore_2;
bspush 65;
newarray 11;
astore_1;
L3: getfield_a_this 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
L3: getfield_a_this 89; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
sconst_0;
baload;
ifne L5;
L4: getfield_a_this 87; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
L4: getfield_a_this 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 120; // T_CLASSORINTERFACE javacard/security/ECKey
invokestatic 124; // com/josh/vku2f/KeyParams.sec256r1params(Ljavacard/security/ECKey;)V
getfield_a_this 87; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
getfield_a_this 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokevirtual 127; // genKeyPair()V
getfield_a_this 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
getfield_a_this 89; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhSet
sconst_0;
sconst_1;
bastore;
L5: getfield_a_this 87; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
L5: getfield_a_this 88; // reference com/josh/vku2f/PinUvAuthProtocolOne.ecDhKeyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 361; // T_CLASSORINTERFACE javacard/security/ECPublicKey
aload_1;
sconst_0;
......@@ -7734,7 +7755,7 @@
L0: aload_0;
invokespecial 293; // java/lang/Object.<init>()V
aload_0;
invokevirtual 337; // resetTokenState()V
invokevirtual 338; // resetTokenState()V
return;
}
......@@ -7750,23 +7771,23 @@
.locals 0;
L0: sconst_0;
putfield_b_this 89; // byte com/josh/vku2f/PinUvAuthToken.permissionsRPID
putfield_b_this 90; // byte com/josh/vku2f/PinUvAuthToken.permissionsRPID
sconst_0;
putfield_b_this 90; // byte com/josh/vku2f/PinUvAuthToken.permissionsSet
putfield_b_this 91; // byte com/josh/vku2f/PinUvAuthToken.permissionsSet
sconst_0;
putfield_b_this 91; // byte com/josh/vku2f/PinUvAuthToken.usageTimer
putfield_b_this 92; // byte com/josh/vku2f/PinUvAuthToken.usageTimer
sconst_0;
putfield_b_this 92; // boolean com/josh/vku2f/PinUvAuthToken.inUseFlag
putfield_b_this 93; // boolean com/josh/vku2f/PinUvAuthToken.inUseFlag
sconst_0;
putfield_b_this 93; // byte com/josh/vku2f/PinUvAuthToken.initialUsageTimeLimit
putfield_b_this 94; // byte com/josh/vku2f/PinUvAuthToken.initialUsageTimeLimit
sconst_0;
putfield_b_this 94; // byte com/josh/vku2f/PinUvAuthToken.userPresentTimeLimit
putfield_b_this 95; // byte com/josh/vku2f/PinUvAuthToken.userPresentTimeLimit
sconst_0;
putfield_b_this 95; // byte com/josh/vku2f/PinUvAuthToken.maxUsageTimePeriod
putfield_b_this 96; // byte com/josh/vku2f/PinUvAuthToken.maxUsageTimePeriod
sconst_0;
putfield_b_this 96; // boolean com/josh/vku2f/PinUvAuthToken.userVerifiedFlag
putfield_b_this 97; // boolean com/josh/vku2f/PinUvAuthToken.userVerifiedFlag
sconst_0;
putfield_b_this 97; // boolean com/josh/vku2f/PinUvAuthToken.userPresentFlag
putfield_b_this 98; // boolean com/josh/vku2f/PinUvAuthToken.userPresentFlag
return;
}
......@@ -7774,7 +7795,7 @@
.stack 1;
.locals 0;
L0: getfield_b_this 92; // boolean com/josh/vku2f/PinUvAuthToken.inUseFlag
L0: getfield_b_this 93; // boolean com/josh/vku2f/PinUvAuthToken.inUseFlag
sreturn;
}
......@@ -7804,14 +7825,14 @@
getstatic_a 288; // reference com/josh/vku2f/Utf8Strings.UTF8_PUBLIC_KEY
arraylength;
newarray 11;
putfield_a 98; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
putfield_a 99; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
getstatic_a 288; // reference com/josh/vku2f/Utf8Strings.UTF8_PUBLIC_KEY
sconst_0;
getfield_a_this 98; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
getfield_a_this 99; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
sconst_0;
getfield_a_this 98; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
getfield_a_this 99; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.type
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
aload_0;
sload_3;
......@@ -7823,7 +7844,7 @@
sconst_0;
getfield_a_this 48; // reference com/josh/vku2f/PublicKeyCredentialDescriptor.id
arraylength;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
return;
}
......@@ -7863,7 +7884,7 @@
aload_1;
sload_2;
invokespecial 185; // com/josh/vku2f/DomString.<init>([BS)V
putfield_a 99; // reference com/josh/vku2f/PublicKeyCredentialEntity.name
putfield_a 100; // reference com/josh/vku2f/PublicKeyCredentialEntity.name
return;
}
......@@ -7897,9 +7918,9 @@
aload_0;
sload_1;
newarray 12;
putfield_a 100; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
putfield_a 101; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
sconst_0;
putfield_s_this 101; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
putfield_s_this 102; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
return;
}
......@@ -7907,14 +7928,14 @@
.stack 5;
.locals 0;
L0: getfield_a_this 100; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
L0: getfield_a_this 101; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
aload_0;
dup;
getfield_s 101; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
getfield_s 102; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
dup_x 18;
sconst_1;
sadd;
putfield_s 101; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
putfield_s 102; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
sload_1;
sastore;
return;
......@@ -7927,23 +7948,23 @@
L0: sconst_0;
sstore_1;
L1: sload_1;
getfield_s_this 101; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
getfield_s_this 102; // short com/josh/vku2f/PublicKeyCredentialParams.listIndex
if_scmpge L9;
L2: getfield_a_this 100; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
L2: getfield_a_this 101; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
sload_1;
saload;
bspush -7;
if_scmpne L4;
L3: bspush 33;
sreturn;
L4: getfield_a_this 100; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
L4: getfield_a_this 101; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
sload_1;
saload;
sspush -257;
if_scmpne L6;
L5: bspush 40;
sreturn;
L6: getfield_a_this 100; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
L6: getfield_a_this 101; // reference com/josh/vku2f/PublicKeyCredentialParams.paramList
sload_1;
saload;
bspush -37;
......@@ -7982,7 +8003,7 @@
.locals 0;
L0: aload_0;
invokespecial 351; // com/josh/vku2f/PublicKeyCredentialEntity.<init>()V
invokespecial 352; // com/josh/vku2f/PublicKeyCredentialEntity.<init>()V
return;
}
......@@ -7996,7 +8017,7 @@
aload_1;
sload_2;
invokespecial 185; // com/josh/vku2f/DomString.<init>([BS)V
putfield_a 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
putfield_a 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
return;
}
......@@ -8004,7 +8025,7 @@
.stack 4;
.locals 0;
L0: getfield_a_this 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
L0: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
aload_1;
sload_2;
sload_3;
......@@ -8016,10 +8037,10 @@
.stack 2;
.locals 0;
L0: getfield_a_this 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
L0: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
aload_1;
getfield_a 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
invokevirtual 353; // checkEquals(Lcom/josh/vku2f/DomString;)Z
getfield_a 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
invokevirtual 354; // checkEquals(Lcom/josh/vku2f/DomString;)Z
sreturn;
}
......@@ -8027,14 +8048,14 @@
.stack 5;
.locals 0;
L0: getfield_a_this 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
L0: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
getfield_a 54; // reference com/josh/vku2f/DomString.str
sconst_0;
aload_1;
sload_2;
getfield_a_this 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
getfield_s 55; // short com/josh/vku2f/DomString.len
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
return;
}
......@@ -8043,7 +8064,7 @@
.stack 1;
.locals 0;
L0: getfield_a_this 102; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
L0: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialRpEntity.rpId
getfield_s 55; // short com/josh/vku2f/DomString.len
sreturn;
}
......@@ -8078,11 +8099,11 @@
.locals 0;
L0: aload_0;
invokespecial 351; // com/josh/vku2f/PublicKeyCredentialEntity.<init>()V
invokespecial 352; // com/josh/vku2f/PublicKeyCredentialEntity.<init>()V
aload_0;
sconst_4;
newarray 10;
putfield_a 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
putfield_a 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_0;
putfield_b_this 52; // byte com/josh/vku2f/PublicKeyCredentialUserEntity.numData
return;
......@@ -8101,13 +8122,13 @@
getfield_a_this 56; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.id
sconst_0;
sload_3;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_1;
baload;
ifne L2;
L1: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
L1: getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_1;
sconst_1;
bastore;
......@@ -8134,13 +8155,13 @@
getfield_a_this 58; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.icon
sconst_0;
sload_2;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_3;
baload;
ifne L2;
L1: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
L1: getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_3;
sconst_1;
bastore;
......@@ -8158,7 +8179,7 @@
L4: return;
.exceptionTable {
// start_block end_block handler_block catch_type_index
L0 L2 L3 355;
L0 L2 L3 356;
}
}
......@@ -8173,11 +8194,11 @@
sload_2;
invokespecial 185; // com/josh/vku2f/DomString.<init>([BS)V
putfield_a 53; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.displayName
getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_2;
baload;
ifne L2;
L1: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
L1: getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_2;
sconst_1;
bastore;
......@@ -8224,12 +8245,12 @@
aload_1;
sload_2;
invokespecial 185; // com/josh/vku2f/DomString.<init>([BS)V
putfield_a 99; // reference com/josh/vku2f/PublicKeyCredentialEntity.name
getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
putfield_a 100; // reference com/josh/vku2f/PublicKeyCredentialEntity.name
getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_0;
baload;
ifne L2;
L1: getfield_a_this 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
L1: getfield_a_this 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
sconst_0;
sconst_1;
bastore;
......@@ -8286,12 +8307,12 @@
.descriptor Ljavacard/security/RandomData; 1.14;
L0: getstatic_a 356; // reference com/josh/vku2f/Random.rng
L0: getstatic_a 357; // reference com/josh/vku2f/Random.rng
ifnonnull L2;
L1: sconst_2;
invokestatic 357; // javacard/security/RandomData.getInstance(B)Ljavacard/security/RandomData;
putstatic_a 356; // reference com/josh/vku2f/Random.rng
L2: getstatic_a 356; // reference com/josh/vku2f/Random.rng
invokestatic 358; // javacard/security/RandomData.getInstance(B)Ljavacard/security/RandomData;
putstatic_a 357; // reference com/josh/vku2f/Random.rng
L2: getstatic_a 357; // reference com/josh/vku2f/Random.rng
areturn;
}
......@@ -8334,27 +8355,27 @@
L0: aload_0;
invokespecial 293; // java/lang/Object.<init>()V
getstatic_a 358; // reference com/josh/vku2f/StoredCredential.randomData
getstatic_a 359; // reference com/josh/vku2f/StoredCredential.randomData
ifnonnull L2;
L1: invokestatic 312; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
putstatic_a 358; // reference com/josh/vku2f/StoredCredential.randomData
L1: invokestatic 313; // com/josh/vku2f/Random.getInstance()Ljavacard/security/RandomData;
putstatic_a 359; // reference com/josh/vku2f/StoredCredential.randomData
L2: aload_0;
bspush 16;
newarray 11;
putfield_a 49; // reference com/josh/vku2f/StoredCredential.credentialId
getstatic_a 358; // reference com/josh/vku2f/StoredCredential.randomData
getstatic_a 359; // reference com/josh/vku2f/StoredCredential.randomData
getfield_a_this 49; // reference com/josh/vku2f/StoredCredential.credentialId
sconst_0;
bspush 16;
invokevirtual 359; // generateData([BSS)V
invokevirtual 360; // generateData([BSS)V
aload_0;
sconst_4;
newarray 11;
putfield_a 104; // reference com/josh/vku2f/StoredCredential.signingCounter
putfield_a 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_0;
putfield_b_this 105; // boolean com/josh/vku2f/StoredCredential.initialised
putfield_b_this 106; // boolean com/josh/vku2f/StoredCredential.initialised
sconst_0;
putfield_b_this 106; // boolean com/josh/vku2f/StoredCredential.hmacEnabled
putfield_b_this 107; // boolean com/josh/vku2f/StoredCredential.hmacEnabled
return;
}
......@@ -8373,14 +8394,14 @@
L0: aload_0;
bspush 32;
newarray 11;
putfield_a 107; // reference com/josh/vku2f/StoredCredential.credRandom
getstatic_a 358; // reference com/josh/vku2f/StoredCredential.randomData
getfield_a_this 107; // reference com/josh/vku2f/StoredCredential.credRandom
putfield_a 108; // reference com/josh/vku2f/StoredCredential.credRandom
getstatic_a 359; // reference com/josh/vku2f/StoredCredential.randomData
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.credRandom
sconst_0;
bspush 32;
invokevirtual 359; // generateData([BSS)V
invokevirtual 360; // generateData([BSS)V
sconst_1;
putfield_b_this 106; // boolean com/josh/vku2f/StoredCredential.hmacEnabled
putfield_b_this 107; // boolean com/josh/vku2f/StoredCredential.hmacEnabled
sconst_1;
sreturn;
}
......@@ -8412,7 +8433,7 @@
.locals 0;
L0: getfield_a_this 51; // reference com/josh/vku2f/StoredCredential.userEntity
getfield_a 103; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
getfield_a 104; // reference com/josh/vku2f/PublicKeyCredentialUserEntity.dataPresent
areturn;
}
......@@ -8426,12 +8447,12 @@
L1: sload_1;
sconst_1;
if_scmple L5;
L2: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L2: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sload_1;
baload;
sspush 255;
if_scmpne L4;
L3: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L3: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sload_1;
sconst_1;
ssub;
......@@ -8441,7 +8462,7 @@
sadd;
s2b;
bastore;
getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sload_1;
sconst_0;
bastore;
......@@ -8449,35 +8470,35 @@
return;
L4: sinc 1 -1;
goto L1;
L5: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L5: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_0;
baload;
sspush 255;
if_scmpne L10;
L6: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L6: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_1;
baload;
sspush 255;
if_scmpne L10;
L7: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L7: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_2;
baload;
sspush 255;
if_scmpne L10;
L8: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L8: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_3;
baload;
sspush 255;
if_scmpne L10;
L9: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L9: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_0;
sconst_4;
sconst_0;
invokestatic 364; // javacard/framework/Util.arrayFillNonAtomic([BSSB)S
invokestatic 365; // javacard/framework/Util.arrayFillNonAtomic([BSSB)S
pop;
invokestatic 268; // javacard/framework/JCSystem.commitTransaction()V
return;
L10: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L10: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_3;
dup2;
baload;
......@@ -8493,12 +8514,12 @@
.stack 5;
.locals 0;
L0: getfield_a_this 104; // reference com/josh/vku2f/StoredCredential.signingCounter
L0: getfield_a_this 105; // reference com/josh/vku2f/StoredCredential.signingCounter
sconst_0;
aload_1;
sload_2;
sconst_4;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
sconst_4;
sreturn;
......@@ -8513,7 +8534,7 @@
aload_1;
sload_2;
bspush 16;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
aload_1;
sload_2;
......@@ -8534,7 +8555,7 @@
bspush 18;
sadd;
bspush 16;
invokestatic 354; // javacard/framework/Util.arrayCopy([BS[BSS)S
invokestatic 353; // javacard/framework/Util.arrayCopy([BS[BSS)S
pop;
return;
}
......@@ -8578,35 +8599,35 @@
.locals 0;
L0: aload_0;
invokespecial 365; // com/josh/vku2f/StoredCredential.<init>()V
invokespecial 366; // com/josh/vku2f/StoredCredential.<init>()V
aload_0;
new 200; // javacard/security/KeyPair
dup;
sconst_5;
sspush 256;
invokespecial 292; // javacard/security/KeyPair.<init>(BS)V
putfield_a 108; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
putfield_a 109; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 120; // T_CLASSORINTERFACE javacard/security/ECKey
invokestatic 124; // com/josh/vku2f/KeyParams.sec256r1params(Ljavacard/security/ECKey;)V
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 127; // genKeyPair()V
aload_0;
aload_1;
invokevirtual 367; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
invokevirtual 368; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
putfield_a 51; // reference com/josh/vku2f/StoredCredential.userEntity
aload_0;
aload_1;
invokevirtual 368; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
invokevirtual 369; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
putfield_a 42; // reference com/josh/vku2f/StoredCredential.rpEntity
aload_0;
bspush 33;
sconst_0;
invokestatic 194; // javacard/security/Signature.getInstance(BZ)Ljavacard/security/Signature;
putfield_a 109; // reference com/josh/vku2f/StoredES256Credential.sig
getfield_a_this 109; // reference com/josh/vku2f/StoredES256Credential.sig
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
putfield_a 110; // reference com/josh/vku2f/StoredES256Credential.sig
getfield_a_this 110; // reference com/josh/vku2f/StoredES256Credential.sig
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 238; // getPrivate()Ljavacard/security/PrivateKey;
sconst_1;
invokevirtual 261; // init(Ljavacard/security/Key;B)V
......@@ -8618,8 +8639,8 @@
.locals 0;
L0: aload_0;
invokevirtual 370; // incrementCounter()V
getfield_a_this 109; // reference com/josh/vku2f/StoredES256Credential.sig
invokevirtual 371; // incrementCounter()V
getfield_a_this 110; // reference com/josh/vku2f/StoredES256Credential.sig
aload_1;
sload_2;
sload_3;
......@@ -8647,15 +8668,15 @@
astore_3;
L1: bspush 65;
sconst_1;
invokestatic 112; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
invokestatic 377; // javacard/framework/JCSystem.makeTransientByteArray(SB)[B
astore 4;
L2: goto L4;
L3: astore 5;
bspush 65;
newarray 11;
astore 4;
L4: getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
L4: getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 361; // T_CLASSORINTERFACE javacard/security/ECPublicKey
aload 4;
sconst_0;
......@@ -8664,7 +8685,7 @@
aload_0;
aload_1;
sload_2;
invokevirtual 371; // doAttestationCommon([BS)V
invokevirtual 372; // doAttestationCommon([BS)V
aload_3;
aload_1;
sload_2;
......@@ -8761,31 +8782,31 @@
.locals 0;
L0: aload_0;
invokespecial 365; // com/josh/vku2f/StoredCredential.<init>()V
invokespecial 366; // com/josh/vku2f/StoredCredential.<init>()V
aload_0;
new 200; // javacard/security/KeyPair
dup;
sconst_2;
sspush 2048;
invokespecial 292; // javacard/security/KeyPair.<init>(BS)V
putfield_a 108; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
putfield_a 109; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 127; // genKeyPair()V
aload_0;
aload_1;
invokevirtual 367; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
invokevirtual 368; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
putfield_a 51; // reference com/josh/vku2f/StoredCredential.userEntity
aload_0;
aload_1;
invokevirtual 368; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
invokevirtual 369; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
putfield_a 42; // reference com/josh/vku2f/StoredCredential.rpEntity
aload_0;
bspush 44;
sconst_0;
invokestatic 194; // javacard/security/Signature.getInstance(BZ)Ljavacard/security/Signature;
putfield_a 110; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
getfield_a_this 110; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
putfield_a 111; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
getfield_a_this 111; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 238; // getPrivate()Ljavacard/security/PrivateKey;
sconst_1;
invokevirtual 261; // init(Ljavacard/security/Key;B)V
......@@ -8797,8 +8818,8 @@
.locals 0;
L0: aload_0;
invokevirtual 373; // incrementCounter()V
getfield_a_this 110; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
invokevirtual 374; // incrementCounter()V
getfield_a_this 111; // reference com/josh/vku2f/StoredPS256Credential.kpSignature
aload_1;
sload_2;
sload_3;
......@@ -8827,7 +8848,7 @@
aload_0;
aload_1;
sload_2;
invokevirtual 374; // doAttestationCommon([BS)V
invokevirtual 375; // doAttestationCommon([BS)V
aload_3;
aload_1;
sload_2;
......@@ -8863,12 +8884,12 @@
sspush 256;
invokevirtual 227; // startByteString(S)S
sstore 4;
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 375; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 376; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
aload_1;
sload 4;
invokeinterface 3 375 5; // javacard/security/RSAPublicKey
invokeinterface 3 376 5; // javacard/security/RSAPublicKey
pop;
aload_3;
sconst_1;
......@@ -8878,12 +8899,12 @@
sconst_3;
invokevirtual 227; // startByteString(S)S
sstore 4;
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 375; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 376; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
aload_1;
sload 4;
invokeinterface 3 375 4; // javacard/security/RSAPublicKey
invokeinterface 3 376 4; // javacard/security/RSAPublicKey
pop;
sspush 305;
sreturn;
......@@ -8919,34 +8940,34 @@
.locals 0;
L0: aload_0;
invokespecial 365; // com/josh/vku2f/StoredCredential.<init>()V
invokespecial 366; // com/josh/vku2f/StoredCredential.<init>()V
aload_0;
new 200; // javacard/security/KeyPair
dup;
sconst_2;
sspush 2048;
invokespecial 292; // javacard/security/KeyPair.<init>(BS)V
putfield_a 108; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
putfield_a 109; // reference com/josh/vku2f/StoredCredential.keyPair
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 127; // genKeyPair()V
aload_0;
aload_1;
invokevirtual 367; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
invokevirtual 368; // getUser()Lcom/josh/vku2f/PublicKeyCredentialUserEntity;
putfield_a 51; // reference com/josh/vku2f/StoredCredential.userEntity
aload_0;
aload_1;
invokevirtual 368; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
invokevirtual 369; // getRp()Lcom/josh/vku2f/PublicKeyCredentialRpEntity;
putfield_a 42; // reference com/josh/vku2f/StoredCredential.rpEntity
aload_0;
bspush 10;
sconst_0;
invokestatic 318; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 111; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
getfield_a_this 111; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokestatic 319; // javacardx/crypto/Cipher.getInstance(BZ)Ljavacardx/crypto/Cipher;
putfield_a 112; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
getfield_a_this 112; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 238; // getPrivate()Ljavacard/security/PrivateKey;
sconst_2;
invokevirtual 377; // init(Ljavacard/security/Key;B)V
invokevirtual 378; // init(Ljavacard/security/Key;B)V
return;
}
......@@ -8955,14 +8976,14 @@
.locals 0;
L0: aload_0;
invokevirtual 378; // incrementCounter()V
getfield_a_this 111; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
invokevirtual 379; // incrementCounter()V
getfield_a_this 112; // reference com/josh/vku2f/StoredRS256Credential.kpSignature
aload_1;
sload_2;
sload_3;
aload 4;
sload 5;
invokevirtual 324; // doFinal([BSS[BS)S
invokevirtual 325; // doFinal([BSS[BS)S
sreturn;
}
......@@ -8985,7 +9006,7 @@
aload_0;
aload_1;
sload_2;
invokevirtual 379; // doAttestationCommon([BS)V
invokevirtual 380; // doAttestationCommon([BS)V
aload_3;
aload_1;
sload_2;
......@@ -9011,7 +9032,7 @@
pop;
aload_3;
sspush 256;
invokevirtual 380; // encodeNegativeUInt16(S)S
invokevirtual 381; // encodeNegativeUInt16(S)S
pop;
aload_3;
sconst_0;
......@@ -9021,12 +9042,12 @@
sspush 256;
invokevirtual 227; // startByteString(S)S
sstore 4;
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 375; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 376; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
aload_1;
sload 4;
invokeinterface 3 375 5; // javacard/security/RSAPublicKey
invokeinterface 3 376 5; // javacard/security/RSAPublicKey
pop;
aload_3;
sconst_1;
......@@ -9036,12 +9057,12 @@
sconst_3;
invokevirtual 227; // startByteString(S)S
sstore 4;
getfield_a_this 108; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 366; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 375; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
getfield_a_this 109; // reference com/josh/vku2f/StoredCredential.keyPair
invokevirtual 364; // getPublic()Ljavacard/security/PublicKey;
checkcast 0 376; // T_CLASSORINTERFACE javacard/security/RSAPublicKey
aload_1;
sload 4;
invokeinterface 3 375 4; // javacard/security/RSAPublicKey
invokeinterface 3 376 4; // javacard/security/RSAPublicKey
pop;
sspush 306;
sreturn;
......
......@@ -19,7 +19,7 @@ public class IDSecret {
private final byte[] RxRp = new byte[4];
public final byte[] PuKp = new byte[65];
public final byte[] sharedSecret = new byte[20];
public final byte[] aesRawKey = new byte[32];
public final byte[] hashedSharedSecret = new byte[32];
public final byte[] Cx = new byte[16];
public final byte[] encryptedCx = new byte[16];
public final byte[] hmac = new byte[32];
......@@ -41,7 +41,7 @@ public class IDSecret {
Util.arrayFill(PuKp, (short)1, (byte)(PuKp.length-1), (byte)0);
Util.arrayFill(sharedSecret, (short)0, (byte)sharedSecret.length, (byte)0);
Util.arrayFill(aesRawKey, (short)0, (byte)aesRawKey.length, (byte)0);
Util.arrayFill(hashedSharedSecret, (short)0, (byte) hashedSharedSecret.length, (byte)0);
Random.getInstance().nextBytes(Cx, (short)0, (short)Cx.length);
Util.arrayFill(encryptedCx, (short)0, (byte)encryptedCx.length, (byte)0);
Util.arrayFill(hmac, (short)0, (byte)hmac.length, (byte)0);
......@@ -63,8 +63,8 @@ public class IDSecret {
}
public void initAesKey(){
sha256.doFinal(sharedSecret, (short)0, (short)20, aesRawKey, (short)0);
aesKey.setKey(aesRawKey, (short)0);
sha256.doFinal(sharedSecret, (short)0, (short)20, hashedSharedSecret, (short)0);
aesKey.setKey(hashedSharedSecret, (short)0);
aesEncrypt.init(aesKey, Cipher.MODE_ENCRYPT, IV_ZERO_AES, (short)0, (short)IV_ZERO_AES.length);
aesDecrypt.init(aesKey, Cipher.MODE_DECRYPT, IV_ZERO_AES, (short)0, (short)IV_ZERO_AES.length);
}
......@@ -90,7 +90,7 @@ public class IDSecret {
aesEncrypt.update(scratch, (short)0, (short)16, outputBuffer, outputOffset);
aesEncrypt.doFinal(scratch, (short)16, (short)16 , outputBuffer, (short)(outputOffset+16) );
Util.arrayCopy(scratch, (short)0, hmac, (short)0, (short)32 );
Util.arrayCopy(outputBuffer, (short)0, hmac, (short)0, (short)32 );
}
/**
......@@ -106,7 +106,7 @@ public class IDSecret {
encoder.encodeByteString(getRxRp(), (short)0, (short)RxRp.length);
encoder.encodeByteString(PuKp, (short)0, (short)PuKp.length);
encoder.encodeByteString(sharedSecret, (short)0, (short)sharedSecret.length);
encoder.encodeByteString(aesRawKey, (short)0 , (short)aesRawKey.length);
encoder.encodeByteString(hashedSharedSecret, (short)0 , (short) hashedSharedSecret.length);
encoder.encodeByteString(Cx, (short)0, (short)Cx.length);
encoder.encodeByteString(encryptedCx, (short)0, (short)encryptedCx.length);
encoder.encodeByteString(hmac, (short)0, (short)hmac.length );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment