about summary refs log tree commit diff
path: root/pkgs/applications/networking/instant-messengers/jackline
diff options
context:
space:
mode:
authorVincent Laporte <vbgl@users.noreply.github.com>2018-01-15 05:01:50 +0100
committerGitHub <noreply@github.com>2018-01-15 05:01:50 +0100
commit550136f516c9c940d602233fedeea7caf0ce5950 (patch)
tree5dc0910c07efca521433ce13d9040f19acb3dfef /pkgs/applications/networking/instant-messengers/jackline
parent9bbaa2a1de90b589be045817b997de8a9ba7aded (diff)
ocamlPackages.asn1-combinators: 0.1.3 -> 0.2.0 (#33566)
* ocamlPackages.asn1-combinators: 0.1.3 -> 0.2.0

* ocamlPackages.x509: 0.5.3 -> 0.6.0

* ocamlPackages.x509: 0.6.0 -> 0.6.1

* ocamlPackages.tls: 0.7.1 -> 0.9.0

* jackline: fix build with ocaml-tls ≥ 0.9.0
Diffstat (limited to 'pkgs/applications/networking/instant-messengers/jackline')
-rw-r--r--pkgs/applications/networking/instant-messengers/jackline/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/jackline/tls-0.9.0.patch29
2 files changed, 31 insertions, 0 deletions
diff --git a/pkgs/applications/networking/instant-messengers/jackline/default.nix b/pkgs/applications/networking/instant-messengers/jackline/default.nix
index 32e7c877614a7..9f85c940c1bc2 100644
--- a/pkgs/applications/networking/instant-messengers/jackline/default.nix
+++ b/pkgs/applications/networking/instant-messengers/jackline/default.nix
@@ -13,6 +13,8 @@ stdenv.mkDerivation rec {
     sha256 = "05z9kvd7gwr59ic7hnmbayhwyyqd41xxz01cvdlcgplk3z7zlwg5";
   };
 
+  patches = [ ./tls-0.9.0.patch ];
+
   buildInputs = with ocamlPackages; [
                   ocaml ocamlbuild findlib topkg ppx_sexp_conv
                   erm_xmpp_0_3 tls nocrypto x509 ocaml_lwt otr astring
diff --git a/pkgs/applications/networking/instant-messengers/jackline/tls-0.9.0.patch b/pkgs/applications/networking/instant-messengers/jackline/tls-0.9.0.patch
new file mode 100644
index 0000000000000..38f38a03a8024
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/jackline/tls-0.9.0.patch
@@ -0,0 +1,29 @@
+diff --git a/cli/cli_config.ml b/cli/cli_config.ml
+index 991ee77..59a0edb 100644
+--- a/cli/cli_config.ml
++++ b/cli/cli_config.ml
+@@ -207,7 +207,9 @@ let configure term () =
+     ask above "CA file: " (fun x -> x) (fun x -> if Sys.file_exists x then `Ok x else `Invalid) term >>= fun trust_anchor ->
+     Lwt_unix.access trust_anchor [ Unix.F_OK ; Unix.R_OK ] >>= fun () ->
+     X509_lwt.certs_of_pem trust_anchor >>= fun tas ->
+-    (match X509.Validation.valid_cas ~time:(Unix.time ()) tas with
++    let time = match Ptime.of_float_s (Unix.time ())
++      with Some time -> time | None -> assert false in
++    (match X509.Validation.valid_cas ~time tas with
+      | [] -> Lwt.fail (Invalid_argument "trust anchor file is empty!")
+      | _ -> Lwt.return (`Trust_anchor trust_anchor))
+   | Some fp -> Lwt.return (`Fingerprint fp) ) >>= fun authenticator ->
+diff --git a/cli/cli_state.ml b/cli/cli_state.ml
+index d5db502..91540c9 100644
+--- a/cli/cli_state.ml
++++ b/cli/cli_state.ml
+@@ -262,7 +262,8 @@ module Connect = struct
+           (match config.Xconfig.authenticator with
+            | `Trust_anchor x -> X509_lwt.authenticator (`Ca_file x)
+            | `Fingerprint fp ->
+-             let time = Unix.gettimeofday () in
++             let time = match Ptime.of_float_s (Unix.gettimeofday ())
++               with Some time -> time | None -> assert false in
+              let fp =
+                Nocrypto.Uncommon.Cs.of_hex
+                  (String.map (function ':' -> ' ' | x -> x) fp)