Skip to content

Commit

Permalink
keylib dep updated
Browse files Browse the repository at this point in the history
  • Loading branch information
r4gus committed Jan 4, 2024
1 parent b44906f commit ddddbf2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
.{
.name = "keypass",
.version = "0.1.0",
.version = "0.2.2",
.dependencies = .{
.keylib = .{
.url = "https://github.com/r4gus/keylib/archive/refs/tags/0.2.1.tar.gz",
.hash = "12205147520e4f21cab7d3c3914f359ed0ddcfa26e94841b889a400bfc1711bbc816",
.url = "https://github.com/r4gus/keylib/archive/refs/tags/0.3.1.tar.gz",
.hash = "122061f7afc3c0b84f2897a153ea430df85a543d2857db241b7d6b47b24c056dfe78",
},
.tresor = .{
.url = "https://github.com/r4gus/tresor/archive/refs/tags/0.1.1.tar.gz",
Expand Down
2 changes: 1 addition & 1 deletion script/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if [ "$path" != "" ]; then
zig="$sub/zig"
fi

git clone https://github.com/r4gus/keypass --branch 0.2.1
git clone https://github.com/r4gus/keypass --branch 0.2.2
cd keypass
../$zig build -Doptimize=ReleaseSmall
rm -rf /usr/local/bin/passkeez
Expand Down
16 changes: 13 additions & 3 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -462,11 +462,21 @@ pub fn auth_fn() !void {
while (true) {
var buffer: [64]u8 = .{0} ** 64;
if (u.read(&buffer)) |packet| {
var response = ctaphid.handle(packet, &auth);
var response = ctaphid.handle(packet);
if (response) |*res| blk: {
defer res.deinit();
switch (res.cmd) {
.cbor => {
var out: [7609]u8 = undefined;
const r = auth.handle(&out, res.data);
std.mem.copy(u8, res._data[0..r.len], r);
res.data = res._data[0..r.len];
},
else => {},
// TODO: handle CMD
}

while (res.next()) |p| {
var iter = res.iterator();
while (iter.next()) |p| {
u.write(p) catch {
break :blk;
};
Expand Down

0 comments on commit ddddbf2

Please sign in to comment.