upstream: github.com/mirleft/ocaml-x509
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

ocaml-x509: Reformat with ocamlformat 0.28.1

+7 -17
+2 -6
lib/private_key.ml
··· 6 6 | `P521 of Crypto_ec.P521.Dsa.priv ] 7 7 8 8 type t = 9 - [ ecdsa 10 - | `RSA of Crypto_pk.Rsa.priv 11 - | `ED25519 of Crypto_ec.Ed25519.priv ] 9 + [ ecdsa | `RSA of Crypto_pk.Rsa.priv | `ED25519 of Crypto_ec.Ed25519.priv ] 12 10 13 11 let key_type = function 14 12 | `RSA _ -> `RSA ··· 33 31 let of_octets data = 34 32 let open Crypto_ec in 35 33 let ec_err e = 36 - Result.map_error 37 - (fun e -> `Msg (Fmt.to_to_string Crypto_ec.pp_error e)) 38 - e 34 + Result.map_error (fun e -> `Msg (Fmt.to_to_string Crypto_ec.pp_error e)) e 39 35 in 40 36 function 41 37 | `RSA -> Error (`Msg "cannot decode an RSA key")
+3 -7
lib/public_key.ml
··· 6 6 | `P521 of Crypto_ec.P521.Dsa.pub ] 7 7 8 8 type t = 9 - [ ecdsa 10 - | `RSA of Crypto_pk.Rsa.pub 11 - | `ED25519 of Crypto_ec.Ed25519.pub ] 9 + [ ecdsa | `RSA of Crypto_pk.Rsa.pub | `ED25519 of Crypto_ec.Ed25519.pub ] 12 10 13 11 module Asn_oid = Asn.OID 14 12 ··· 39 37 let to_err = function 40 38 | Ok r -> r 41 39 | Error e -> 42 - parse_error "failed to decode public EC key %a" 43 - Crypto_ec.pp_error e 40 + parse_error "failed to decode public EC key %a" Crypto_ec.pp_error e 44 41 45 42 let reparse_pk = 46 43 let open Crypto_ec in ··· 134 131 | `RSA key, `RSA_PKCS1 -> 135 132 let hashp x = x = hash in 136 133 let* d = hashed hash data in 137 - ok_if_true 138 - (Crypto_pk.Rsa.PKCS1.verify ~hashp ~key ~signature (`Digest d)) 134 + ok_if_true (Crypto_pk.Rsa.PKCS1.verify ~hashp ~key ~signature (`Digest d)) 139 135 | `ED25519 key, `ED25519 -> begin 140 136 match data with 141 137 | `Message msg -> ok_if_true (Ed25519.verify ~key signature ~msg)
+1 -2
lib/rc2.ml
··· 416 416 decrypt_one ~key ~data ~off:(i * block) dst 417 417 done; 418 418 Crypto.Uncommon.unsafe_xor_into iv ~src_off:0 dst ~dst_off:0 block; 419 - Crypto.Uncommon.unsafe_xor_into data ~src_off:0 dst ~dst_off:block 420 - (l - block); 419 + Crypto.Uncommon.unsafe_xor_into data ~src_off:0 dst ~dst_off:block (l - block); 421 420 Bytes.unsafe_to_string dst
+1 -2
tests/regression.ml
··· 182 182 in 183 183 match Private_key.decode_pem data with 184 184 | Ok (`ED25519 k as ke) 185 - when String.equal ed25519_priv (Crypto_ec.Ed25519.priv_to_octets k) 186 - -> 185 + when String.equal ed25519_priv (Crypto_ec.Ed25519.priv_to_octets k) -> 187 186 let encoded = Private_key.encode_pem ke in 188 187 if not (String.equal encoded data) then 189 188 Alcotest.failf "ED25519 encoding failed"