From d144aca86e3017814e7b1ba324fe8d111514db38 Mon Sep 17 00:00:00 2001 From: Hannes Mehnert Date: Tue, 15 Oct 2019 18:22:13 +0200 Subject: [PATCH] adapt to x509 0.8.1 API --- openvpn.opam | 5 ++++- src/config.ml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/openvpn.opam b/openvpn.opam index 695a28f7..f052cc56 100644 --- a/openvpn.opam +++ b/openvpn.opam @@ -40,7 +40,7 @@ depends: [ "rresult" "tls" "dns-client" {>= "4.0.0"} - "x509" {>= "0.7.0"} + "x509" {>= "0.8.0"} "duration" # mirage: @@ -49,4 +49,7 @@ depends: [ "tcpip" {>= "3.7.8"} "mirage-random" "mirage-clock" + + "crowbar" {with-test} + "alcotest" {with-test} ] diff --git a/src/config.ml b/src/config.ml index 49ac66ce..90f6c82a 100644 --- a/src/config.ml +++ b/src/config.ml @@ -157,10 +157,10 @@ module Conf_map = struct # Key fingerprint (sha256): %a\n%s" entry_typ entry_typ - (match X509.Distinguished_name.(find CN (X509.Certificate.subject cert)) with + (match X509.(Distinguished_name.common_name (Certificate.subject cert)) with | None -> "NO common name" | Some x -> x) - (Fmt.(pair ~sep:(unit" -> ") Ptime.(pp_human()) Ptime.(pp_human())) - ) (X509.Certificate.validity cert) + (Fmt.(pair ~sep:(unit" -> ") Ptime.(pp_human()) Ptime.(pp_human()))) + (X509.Certificate.validity cert) Fmt.(list ~sep:(unit " ") Domain_name.pp) (Domain_name.Set.elements (X509.Certificate.hostnames cert)) Hex.pp (Hex.of_cstruct (X509.Certificate.fingerprint `SHA256 cert))