Skip to content

Commit

Permalink
Added authdata
Browse files Browse the repository at this point in the history
Signed-off-by: Reza Tavakoli <[email protected]>
  • Loading branch information
tavrez committed Oct 6, 2020
1 parent 53d06e5 commit c3a08df
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- You can now create and use keys created with `no-touch-required` option.
- Support for `verify-required` option is added(with a little limitation).
- New attestation data will be returned if available(a bit different but correct).

### Changed

- Bumped API version to 0x00070000 (requires OpenSSH v8.4p1).

## [v1] (OpenSSH middleware API version 5)

- Check branch v1 [CHANGELOG.md](https://github.com/tavrez/openssh-sk-winhello/blob/v1/CHANGELOG.md).
- [Branch v1 changelog](https://github.com/tavrez/openssh-sk-winhello/blob/v1/CHANGELOG.md).

[Unreleased]: https://github.com/tavrez/openssh-sk-winhello/compare/v1.0.2...HEAD
[v1]: https://github.com/tavrez/openssh-sk-winhello/tree/v1
12 changes: 9 additions & 3 deletions src/winhello.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,9 +351,15 @@ int sk_enroll(uint32_t alg, const uint8_t *challenge, size_t challenge_len, cons
response->signature_len = att->cbSignature;
memcpy(response->signature, att->pbSignature, att->cbSignature);

// TODO: authentication data
response->authdata = NULL;
response->authdata_len = 0;
if ((response->authdata = calloc(1, pWebAuthNCredentialAttestation->cbAuthenticatorData + 2)) == NULL)
{
skdebug(__func__, "calloc authdata failed");
goto out;
}
response->authdata_len = pWebAuthNCredentialAttestation->cbAuthenticatorData + 2;
response->authdata[0] = 0x58;
response->authdata[1] = pWebAuthNCredentialAttestation->cbAuthenticatorData;
memcpy(response->authdata + 2, pWebAuthNCredentialAttestation->pbAuthenticatorData, pWebAuthNCredentialAttestation->cbAuthenticatorData);
}
}
*enroll_response = response;
Expand Down

0 comments on commit c3a08df

Please sign in to comment.