From 312eb6e569a3b61325fcf15112500fbf0face65a Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 11 Sep 2018 22:11:20 +0200 Subject: [PATCH] syncthing-device-id: use openssl --- krebs/5pkgs/simple/syncthing-device-id.nix | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/krebs/5pkgs/simple/syncthing-device-id.nix b/krebs/5pkgs/simple/syncthing-device-id.nix index 9fe2b8ffb..9533800fd 100644 --- a/krebs/5pkgs/simple/syncthing-device-id.nix +++ b/krebs/5pkgs/simple/syncthing-device-id.nix @@ -1,4 +1,4 @@ -{ writePython2Bin }: +{ openssl, writePython2Bin }: writePython2Bin "syncthing-device-id" { flakeIgnore = [ @@ -24,7 +24,12 @@ writePython2Bin "syncthing-device-id" { return alphabet[-result] def main(incert): - der_data = subprocess.check_output(['openssl', 'x509', '-outform', 'DER'], stdin=incert) + der_data = subprocess.check_output([ + '${openssl}/bin/openssl', + 'x509', + '-outform', + 'DER', + ], stdin=incert) data_hash = hashlib.sha256(der_data) b32_hash = base64.b32encode(data_hash.digest()).decode('ascii')