-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tillitis-{gateware,firmware,qemu}: init at 23.03.1 #227404
Conversation
The emulator works!
PR submitted upstream to rebase their qemu fork to v8.0.0: |
buildInputs = [ | ||
sdcc | ||
]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not nativeBuildInputs?
diff --git a/pkgs/misc/tillitis/default.nix b/pkgs/misc/tillitis/default.nix
new file mode 100644
index 00000000000..a6c8c994263
--- /dev/null
+++ b/pkgs/misc/tillitis/default.nix
@@ -0,0 +1,15 @@
+{ makeScopeWithSplicing
+, generateSplicesForMkScope
+}:
+
+makeScopeWithSplicing (generateSplicesForMkScope "tillitis") (_: { }) (_: { }) (self:
+let
+ inherit (self) callPackage;
+in
+{
+ firmware-softcpu = callPackage ./firmware-softcpu.nix { };
+ firmware-usb2serial = callPackage ./firmware-usb2serial.nix { };
+ gateware = callPackage ./gateware.nix { };
+ qemu = callPackage ./qemu.nix { };
+
+})
diff --git a/pkgs/misc/tillitis/qemu.nix b/pkgs/misc/tillitis/qemu.nix
index dddc5e16d32..d752566ba34 100644
--- a/pkgs/misc/tillitis/qemu.nix
+++ b/pkgs/misc/tillitis/qemu.nix
@@ -2,16 +2,15 @@
, stdenv
, fetchFromGitHub
, fetchpatch
-, qemu
+, pkgs
, git
, buildPackages
, writeScript
-, tillitis-qemu # for passthru
-, tillitis-firmware-softcpu # for passthru
+, firmware-softcpu # for passthru
}:
-(qemu.override { enableDocs = false; })
- .overrideAttrs(previousAttrs: {
+(pkgs.qemu.override { enableDocs = false; })
+ .overrideAttrs(finalAttrs: previousAttrs: {
version = "8.0.0";
# This is just `git rebase` of the tillitis fork forward to
@@ -53,10 +52,10 @@
passthru = {
run = writeScript "tillitis-qemu-run" ''
exec \
- ${tillitis-qemu}/bin/qemu-system-riscv32 \
+ ${finalAttrs.finalPackage}/bin/qemu-system-riscv32 \
-nographic \
-M tk1,fifo=chrid \
- -bios ${tillitis-firmware-softcpu}/firmware.elf \
+ -bios ${firmware-softcpu}/firmware.elf \
-chardev pty,id=chrid \
"$@"
'';
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a1c8ded4c9d..eaba9f73d42 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -39750,10 +39750,7 @@ with pkgs;
});
};
- tillitis-firmware-softcpu = callPackage ../misc/tillitis/firmware-softcpu.nix { };
- tillitis-firmware-usb2serial = callPackage ../misc/tillitis/firmware-usb2serial.nix { };
- tillitis-gateware = callPackage ../misc/tillitis/gateware.nix { };
- tillitis-qemu = callPackage ../misc/tillitis/qemu.nix { };
+ tillitis = import ../misc/tillitis/default.nix { inherit makeScopeWithSplicing generateSplicesForMkScope; };
duti = callPackage ../os-specific/darwin/duti {
inherit (darwin.apple_sdk.frameworks) ApplicationServices; conversion to a scope, LMK if you want me to commit it |
You won't be able to try the FPGA bitstream (what you call gateware) on an ordinary TKey bought from the Tillitis shop. It has already been provisioned with a bitstream inside the FPGA's own configuration memory and locked down. Please ping me at mc at tillitis.se and I'll see what I can do. |
I assume this means you've blown some kind of "no more programming" eFuse, rather than letting the user do so themselves. Is this mentioned anywhere in the documentation? I feel somewhat bait-and-switched here. How is the user supposed to know what bitstream is on the FPGA if they can't load it themselves? If they can't generate their own UDS how can they be sure you didn't keep a copy of it? Since the FPGA programming pins aren't accessible via USB (or at least shouldn't be) and these ICE FPGAs are not tamper-proof devices (i.e. they are not secure against physical attack) I'm not sure what threat model this is intended to protect against. Edit: wow, looks like there was a rug pull three weeks ago. This is pretty disorienting for people who've been following your project for many months. You should be more up-front about this. |
I'm sorry you feel bait-and-switched. Currently only the locked-down end-user version is available in the We will update the documentation and the shop to state very clearly that The plan is to sell at least two products: A locked-down end-user TKey You can verify the TKey you have with the tkey-verification program. You have no way of knowing if we kept the UDS (we don't) but you are |
I convinced 2 friends to buy 2 of them (and myself 2 of them) because of this feature… :C. |
That's a bit of a shame, me too... |
Wow, Tillitis came through; they're selling unlocked TKeys through their storefront. I must be getting jaded; I had long ago stopped expecting that level of integrity from hardware vendors. Very impressed. It may be a while before I get back to pushing this PR forward, but I am hacking on this material locally again. |
is anyone working on packaging the SSH Agent for TKey? I'm stuck at trying to link monocypher with tkey-device-signer |
2023-Apr-21
: the emulator works! 🎉What is this?
Tillitis is an
owner-controlled(Edit: apparently I have been hoodwinked) cryptographic token, created by Mullvad.Description of changes
clang
,qemu
,sdcc
, and FPGA circuit synthesis tools (yosys
/nextpnr
) instead of the dockerified toolchain that Tillitis provides.I'm probably abusing
pkgsCross
here. But I can't get a fullriscv32-none-elf
-targetedclang
to compile, even after spending a lot of time fighting withllvmPackages.libstdcxx
(needed for a full stdenv bootstrap even though Tillitis doesn't use C++).Things done