@@ -33,13 +33,22 @@ const (
3333 // including the UserPresent (UP) and AttestedCredentialData (AT) flags would be done
3434 // by using the value 65.
3535 // AT(64) + UP(1) = 65
36- AttObjFlagUserPresent_UP = 1
37- AttObjFlagUserVerified_UV = 2
38- AttObjFlagAttestedCredData_AT = 64
39- AttObjFlagExtensionData_ED = 128
36+ // See https://www.w3.org/TR/webauthn-2/#flags.
37+
38+ // AttObjFlagUserPresent (UP) is the flag that indicates the user is present (UP).
39+ AttObjFlagUserPresent = 1
40+
41+ // AttObjFlagUserVerified is the flag that indicates the user is verified (UV).
42+ AttObjFlagUserVerified = 2
43+
44+ // AttObjFlagAttestedCredData is the flag that indicates attested credential data is included (AT).
45+ AttObjFlagAttestedCredData = 64
46+
47+ // AttObjFlagExtensionData is the flag that indicates extension data is included (ED).
48+ AttObjFlagExtensionData = 128
4049)
4150
42- // Internal type for ASN1 coercion
51+ // DsaSignature is an internal type for ASN1 coercion
4352type DsaSignature struct {
4453 R , S * big.Int
4554}
@@ -128,7 +137,7 @@ func GetAuthDataAndPrivateKey(rpID, keyHandle string) (authDataStr string, authD
128137 authData = append (authData , r )
129138 }
130139
131- authData = append (authData , byte (AttObjFlagAttestedCredData_AT + AttObjFlagUserPresent_UP )) // AT & UP flags
140+ authData = append (authData , byte (AttObjFlagAttestedCredData + AttObjFlagUserPresent )) // AT & UP flags
132141
133142 // Add 4 bytes for counter = 0 (for now, just make it 0)
134143 authData = append (authData , []byte {byte (0 ), byte (0 ), byte (0 ), byte (0 )}... )
0 commit comments