Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
Fido2Applet
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Josh Ji
Fido2Applet
Commits
d8447cdd
Commit
d8447cdd
authored
Nov 02, 2022
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove attestation payload in authMakeCredential()
parent
8cfdaad1
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1147 additions
and
1269 deletions
+1147
-1269
build/javacard/applet.cap
build/javacard/applet.cap
+0
-0
build/javacard/applet.exp/vku2f.jar
build/javacard/applet.exp/vku2f.jar
+0
-0
build/javacard/applet.jca
build/javacard/applet.jca
+1105
-1228
src/main/java/com/josh/vku2f/CTAP2.java
src/main/java/com/josh/vku2f/CTAP2.java
+42
-41
No files found.
build/javacard/applet.cap
View file @
d8447cdd
No preview for this file type
build/javacard/applet.exp/vku2f.jar
View file @
d8447cdd
No preview for this file type
build/javacard/applet.jca
View file @
d8447cdd
This diff is collapsed.
Click to expand it.
src/main/java/com/josh/vku2f/CTAP2.java
View file @
d8447cdd
...
@@ -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
// */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment