Changeset 6757


Ignore:
Timestamp:
Jun 1, 2022, 9:43:04 AM (16 months ago)
Author:
Nicklas Nordborg
Message:

References #1396: Implement an login extension for WebAuthn?

Changed the signature counter to long instead of int since that is what the WebAuthn API uses (AssertionResult.getSignatureCount()).

Location:
extensions/net.sf.basedb.webauthn/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.webauthn/trunk/src/net/sf/basedb/webauthn/LoginProcessHandler.java

    r6756 r6757  
    196196        if (publicKey != null)
    197197        {
    198           Integer count = (Integer)user.getExtended("webAuthnSignatureCount");
     198          Number count = (Number)user.getExtended("webAuthnSignatureCount");
    199199          RegisteredCredential cred = RegisteredCredential.builder()
    200200            .credentialId(credentialId)
    201201            .userHandle(userHandle)
    202202            .publicKeyCose(ByteArray.fromBase64(publicKey))
    203             .signatureCount(count == null ? 0 : count)
     203            .signatureCount(count == null ? 0 : count.longValue())
    204204            .build();
    205205          return Optional.of(cred);
     
    223223        if (publicKey != null && userHandle != null)
    224224        {
    225           Integer count = (Integer)user.getExtended("webAuthnSignatureCount");
     225          Number count = (Number)user.getExtended("webAuthnSignatureCount");
    226226          RegisteredCredential cred = RegisteredCredential.builder()
    227227            .credentialId(credentialId)
    228228            .userHandle(ByteArray.fromBase64(userHandle))
    229229            .publicKeyCose(ByteArray.fromBase64(publicKey))
    230             .signatureCount(count == null ? 0 : count)
     230            .signatureCount(count == null ? 0 : count.longValue())
    231231            .build();
    232232          return Collections.singleton(cred);
  • extensions/net.sf.basedb.webauthn/trunk/src/net/sf/basedb/webauthn/WebAuthnAuthenticationManager.java

    r6754 r6757  
    7878    }
    7979    AssertionResult result = handler.processAssertionResponse(assertionResponse);
    80     user.setExtended("webAuthnSignatureCount", (int)result.getSignatureCount());
     80    user.setExtended("webAuthnSignatureCount", result.getSignatureCount());
    8181    auth = new AuthenticatedUser(WebAuthn.AUTHENTICATION_METHOD, user);
    8282    return auth;
  • extensions/net.sf.basedb.webauthn/trunk/webauthn-extended-properties.xml

    r6747 r6757  
    1010  <class name="UserData">
    1111    <property
    12       name="webAuthnSerial"
    13       title="WA Serial Number"
    14       description="Serial number of the security key (optional)"
    15       column="wa_serial"
     12      name="webAuthnUserHandle"
     13      title="WA User Handle"
     14      description="Unique ID for the user within the WebAuthn system"
     15      column="wa_userhandle"
    1616      type="string"
    1717      length="255"
     
    1919    />
    2020    <property
    21       name="webAuthnUserHandle"
    22       title="WA User Handle"
    23       description="Unique ID for the user within the WebAuthn system"
    24       column="wa_userhandle"
     21      name="webAuthnSerial"
     22      title="WA Serial"
     23      description="Serial number of the security key (optional)"
     24      column="wa_serial"
    2525      type="string"
    2626      length="255"
     
    4949    <property
    5050      name="webAuthnSignatureCount"
    51       title="WA Signature Count"
    52       description="A counter that may be used by the authenticator"
     51      title="WA Signature Counter"
     52      description="A counter that may be used by the authenticator to make it harder for replay attacks"
    5353      column="wa_signature_count"
    54       type="int"
     54      type="long"
    5555      restricted-edit="true"
    5656      hidden="true"
Note: See TracChangeset for help on using the changeset viewer.