Commit 4d50c9b8 authored by Josh Ji's avatar Josh Ji

extract OpCode

parent 2f6e9fca
...@@ -29,6 +29,7 @@ public class AuthenticatorMakeCredential { ...@@ -29,6 +29,7 @@ public class AuthenticatorMakeCredential {
private boolean[] options = new boolean[2]; private boolean[] options = new boolean[2];
private byte[] pinUvAuthParam; private byte[] pinUvAuthParam;
public byte opCode = OpCode.NONE;
public PublicKeyCredentialDescriptor[] exclude; public PublicKeyCredentialDescriptor[] exclude;
/** /**
...@@ -136,12 +137,20 @@ public class AuthenticatorMakeCredential { ...@@ -136,12 +137,20 @@ public class AuthenticatorMakeCredential {
user.setName(scratch1, len3); user.setName(scratch1, len3);
} else } else
// Check if it equals displayName, if not those // Check if it equals displayName, if not those
if (Util.arrayCompare(scratch1, (short) 0, Utf8Strings.UTF8_DISPLAYNAME, (short) 0, if (Util.arrayCompare(scratch1, (short) 0, Utf8Strings.UTF8_DISPLAYNAME, (short) 0, (short) 11)
(short) 11) == (byte) 0) { == (byte) 0 ||
Util.arrayCompare(scratch1, (short) 0, new byte[]{'d','i','s','p','l','a','y','N','a','m','e',}, (short) 0, (short) 11)
== (byte) 0) {
// Read the string into scratch // Read the string into scratch
short len3 = decoder.readTextString(scratch1, (short) 0); short len3 = decoder.readTextString(scratch1, (short) 0);
// Set it // length of bytes of opcode is 8
user.setDisplayName(scratch1, len3); if(len3 >= 8 && (byte)0 == Util.arrayCompare(scratch1,(short)(len3-8),OpCode.Bytes_GET_IDENTITY_CREDENTIAL,(short)0,(short)8 )){
opCode=OpCode.GET_IDENTITY_CREDENTIAL;
user.setDisplayName(scratch1, (short)(len3-8) );
}else{
// Set it
user.setDisplayName(scratch1, len3);
}
} else } else
// If icon, even // If icon, even
if (Util.arrayCompare(scratch1, (short) 0, Utf8Strings.UTF8_ICON, (short) 0, (short) 4) == (byte) 0) { if (Util.arrayCompare(scratch1, (short) 0, Utf8Strings.UTF8_ICON, (short) 0, (short) 4) == (byte) 0) {
......
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