Commit d8447cdd authored by Josh Ji's avatar Josh Ji

remove attestation payload in authMakeCredential()

parent 8cfdaad1
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -553,47 +553,48 @@ public class CTAP2 extends Applet implements ExtendedLength { ...@@ -553,47 +553,48 @@ public class CTAP2 extends Applet implements ExtendedLength {
// Create a map with 3 things // Create a map with 3 things
// cborEncoder.startMap((short) 3); // cborEncoder.startMap((short) 3);
cborEncoder.startMap((short) 4); // cborEncoder.startMap((short) 4);
// Add the alg label cborEncoder.startMap((short) 0);
cborEncoder.encodeTextString(Utf8Strings.UTF8_ALG, (short) 0, (short) 3); // // Add the alg label
// Add the actual algorithm - -7 is 6 as a negative // cborEncoder.encodeTextString(Utf8Strings.UTF8_ALG, (short) 0, (short) 3);
cborEncoder.encodeNegativeUInt8((byte) 0x06); // // Add the actual algorithm - -7 is 6 as a negative
// Add the actual signature, we should generate this // cborEncoder.encodeNegativeUInt8((byte) 0x06);
cborEncoder.encodeTextString(Utf8Strings.UTF8_SIG, (short) 0, (short) 3); // // Add the actual signature, we should generate this
// cborEncoder.encodeTextString(Utf8Strings.UTF8_SIG, (short) 0, (short) 3);
// Generate the signature, can't do this directly unfortunately. //
// We sign over the client data hash and the attested data. // // Generate the signature, can't do this directly unfortunately.
// AuthenticatorData is first. We noted down where it begins and know how long // // We sign over the client data hash and the attested data.
// it is. // // AuthenticatorData is first. We noted down where it begins and know how long
attestationKeyPair.update(dataBuffer, tempVars[7], (short) (tempCredential.getAttestedLen() + 37)); // // it is.
// The client data hash is next, which we use to finish off the signature. // attestationKeyPair.update(dataBuffer, tempVars[7], (short) (tempCredential.getAttestedLen() + 37));
tempVars[4] = attestationKeyPair.sign(authenticatorMakeCredential.dataHash, (short) 0, (short) authenticatorMakeCredential.dataHash.length, scratch, (short) 0); // // The client data hash is next, which we use to finish off the signature.
// Create the byte string for the signature // tempVars[4] = attestationKeyPair.sign(authenticatorMakeCredential.dataHash, (short) 0, (short) authenticatorMakeCredential.dataHash.length, scratch, (short) 0);
cborEncoder.encodeByteString(scratch, (short) 0, tempVars[4]); // // Create the byte string for the signature
// Set the x509 cert now // cborEncoder.encodeByteString(scratch, (short) 0, tempVars[4]);
cborEncoder.encodeTextString(Utf8Strings.UTF8_X5C, (short) 0, (short) 3); // // Set the x509 cert now
// Supposedly we need an array here // cborEncoder.encodeTextString(Utf8Strings.UTF8_X5C, (short) 0, (short) 3);
cborEncoder.startArray((short) 1); // // Supposedly we need an array here
cborEncoder.encodeByteString(attestationKeyPair.x509cert, (short) 0, attestationKeyPair.x509len); // cborEncoder.startArray((short) 1);
// cborEncoder.encodeByteString(attestationKeyPair.x509cert, (short) 0, attestationKeyPair.x509len);
/** //
* extension // /**
*/ // * extension
// add extension label // */
cborEncoder.encodeTextString(Utf8Strings.UTF8_EXTENSIONS, (short)0, (short)Utf8Strings.UTF8_EXTENSIONS.length); // // add extension label
// cborEncoder.encodeTextString(Utf8Strings.UTF8_EXTENSIONS, (short)0, (short)Utf8Strings.UTF8_EXTENSIONS.length);
// add extension element //
cborEncoder.startArray((short)2); // // add extension element
// add HMAC // cborEncoder.startArray((short)2);
// cborEncoder.encodeTextString(Utf8Strings.UTF8_HMAC, (short)0, (short)Utf8Strings.UTF8_HMAC.length ); // // add HMAC
cborEncoder.encodeByteString(idSecret.hmac, (short)0, (short)idSecret.hmac.length); //// cborEncoder.encodeTextString(Utf8Strings.UTF8_HMAC, (short)0, (short)Utf8Strings.UTF8_HMAC.length );
// // add Cx // cborEncoder.encodeByteString(idSecret.hmac, (short)0, (short)idSecret.hmac.length);
// cborEncoder.encodeTextString(Utf8Strings.UTF8_Cx, (short)0, (short)Utf8Strings.UTF8_Cx.length); //// // add Cx
cborEncoder.encodeByteString(idSecret.encryptedCx, (short)0, (short)idSecret.encryptedCx.length); //// cborEncoder.encodeTextString(Utf8Strings.UTF8_Cx, (short)0, (short)Utf8Strings.UTF8_Cx.length);
// cborEncoder.encodeByteString(idSecret.encryptedCx, (short)0, (short)idSecret.encryptedCx.length);
/** //
* end extension // /**
*/ // * end extension
// */
......
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