Skip to content

Commit

Permalink
tried to fix firefox bug (firefox sends a MSG request) but I failed. …
Browse files Browse the repository at this point in the history
…CTAP2 spec states in 7.2.4 (Disabling CTAP1/U2F) that one has to respond with a SW_COMMAND_NOT_ALLOWED for U2F_REGISTER and U2F_AUTHENTICATE but no word about U2F_VERSION which is send by firefox.
  • Loading branch information
r4gus committed Aug 8, 2023
1 parent 3364312 commit 8988b4f
Show file tree
Hide file tree
Showing 6 changed files with 425 additions and 254 deletions.
23 changes: 22 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,13 +300,34 @@ This is all theoretical! At the end it depends on the actual configuration.
|:-----------------:|:----------:|
| MUST support the hmac-secret extension | |
| clientPin or uv + resident key ||
| credMgmt | |
| credMgmt | |
| MUST support credProtect extension ||
| pinUvAuthToken ||
| PIN/UV auth protocol two support ||

</details>

<details>
<summary><ins>Browser Support</ins></summary>

### USB

| Browser | Credential Creation | Login | PassKey Creation | PassKey Login |
|:-------:|:-------------------:|:-----:|:----------------:|:-------------:|
| Brave |||||
| Chromium |||||
| Firefox | | | ||

### NFC

n.a.

### Bluetooth

n.a.

</details>

## Resources

- [CTAP2](https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-errata-20220621.html#intro) - FIDO Alliance
Expand Down
4 changes: 2 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ pub fn build(b: *std.build.Builder) !void {
// ++++++++++++++++++++++++++++++++++++++++++++

const authenticator = b.addExecutable(.{
.name = "platauth",
.name = "passkee",
.root_source_file = .{ .path = "platform-auth/main.zig" },
.target = target,
.optimize = optimize,
});
authenticator.addModule("fido", fido_module);
authenticator.addModule("zbor", zbor_module);
authenticator.addModule("cks", cks_module);
authenticator.linkSystemLibraryPkgConfigOnly("libnotify");
authenticator.linkLibC();
b.installArtifact(authenticator);

Expand Down
15 changes: 14 additions & 1 deletion lib/ctap/transports/ctaphid/authenticator.zig
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,20 @@ pub fn handle(packet: []const u8, auth: anytype) ?CtapHidMessageIterator {
// execute the command
switch (S.cmd.?) {
.msg => {
return S.@"error"(ErrorCodes.invalid_cmd);
std.debug.print("message {s}\n", .{std.fmt.fmtSliceHexUpper(S.data[0..S.bcnt])});
var response = resp.CtapHidMessageIterator.new(S.busy.?, S.cmd.?);

if (S.data[1] == 3) {
var d = auth.allocator.alloc(u8, 10) catch unreachable;
@memcpy(d, "FIDO_2_0\x69\x86");
response.data = d;
} else {
var d = auth.allocator.alloc(u8, 2) catch unreachable;
@memcpy(d, "\x69\x86");
response.data = d;
}

return response;
},
.cbor => {
var response = resp.CtapHidMessageIterator.new(S.busy.?, S.cmd.?);
Expand Down
94 changes: 0 additions & 94 deletions platform-auth/callbacks.zig

This file was deleted.

56 changes: 0 additions & 56 deletions platform-auth/fs.zig

This file was deleted.

Loading

0 comments on commit 8988b4f

Please sign in to comment.