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
313e68ad
An error occurred while fetching merge requests data.
Commit
313e68ad
authored
2 years ago
by
Josh Ji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
code review
getPuKxCx
parent
8906f0a4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
src/main/java/com/josh/vku2f/CTAP2.java
src/main/java/com/josh/vku2f/CTAP2.java
+10
-1
No files found.
src/main/java/com/josh/vku2f/CTAP2.java
View file @
313e68ad
...
@@ -415,8 +415,12 @@ public class CTAP2 extends Applet implements ExtendedLength {
...
@@ -415,8 +415,12 @@ public class CTAP2 extends Applet implements ExtendedLength {
cborDecoder
.
init
(
dataBuffer
,
(
short
)
1
,
dataLength
);
cborDecoder
.
init
(
dataBuffer
,
(
short
)
1
,
dataLength
);
try
{
try
{
cborDecoder
.
readMajorType
(
CBORBase
.
TYPE_ARRAY
);
cborDecoder
.
readMajorType
(
CBORBase
.
TYPE_ARRAY
);
// read IDx
short
length
=
cborDecoder
.
readTextString
(
scratch
,
(
short
)
0
);
short
length
=
cborDecoder
.
readTextString
(
scratch
,
(
short
)
0
);
idSecret
.
IDx
=
new
DomString
(
scratch
,
length
);
idSecret
.
IDx
=
new
DomString
(
scratch
,
length
);
// read PuKp
cborDecoder
.
readByteString
(
scratch
,
(
short
)
0
);
cborDecoder
.
readByteString
(
scratch
,
(
short
)
0
);
Util
.
arrayCopy
(
scratch
,
(
short
)
8
,
idSecret
.
PuKp
,
(
short
)
1
,
(
short
)
64
);
Util
.
arrayCopy
(
scratch
,
(
short
)
8
,
idSecret
.
PuKp
,
(
short
)
1
,
(
short
)
64
);
}
catch
(
UserException
e
)
{
}
catch
(
UserException
e
)
{
...
@@ -429,14 +433,19 @@ public class CTAP2 extends Applet implements ExtendedLength {
...
@@ -429,14 +433,19 @@ public class CTAP2 extends Applet implements ExtendedLength {
idSecret
.
initAesKey
();
idSecret
.
initAesKey
();
idSecret
.
encryptCx
();
idSecret
.
encryptCx
();
// make output cbor
cborEncoder
.
init
(
dataBuffer
,
(
short
)
0
,
(
short
)
1200
);
cborEncoder
.
init
(
dataBuffer
,
(
short
)
0
,
(
short
)
1200
);
cborEncoder
.
startArray
((
short
)
2
);
cborEncoder
.
startArray
((
short
)
2
);
// put PuKx
short
length
=
attestationKeyPair
.
getPubkey
(
scratch
,
(
short
)
0
);
short
length
=
attestationKeyPair
.
getPubkey
(
scratch
,
(
short
)
0
);
cborEncoder
.
encodeByteString
(
scratch
,
(
short
)
0
,
length
);
cborEncoder
.
encodeByteString
(
scratch
,
(
short
)
0
,
length
);
// put encryptedCx
cborEncoder
.
encodeByteString
(
idSecret
.
encryptedCx
,
(
short
)
0
,
(
short
)
idSecret
.
encryptedCx
.
length
);
cborEncoder
.
encodeByteString
(
idSecret
.
encryptedCx
,
(
short
)
0
,
(
short
)
idSecret
.
encryptedCx
.
length
);
//for test
//for test
idSecret
.
getHMAC
(
scratch
,
(
short
)
0
);
//
idSecret.getHMAC(scratch, (short) 0);
apdu
.
setOutgoing
();
apdu
.
setOutgoing
();
apdu
.
setOutgoingLength
(
cborEncoder
.
getCurrentOffset
());
apdu
.
setOutgoingLength
(
cborEncoder
.
getCurrentOffset
());
...
...
This diff is collapsed.
Click to expand it.
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