summaryrefslogtreecommitdiff
path: root/security/ocaml-cryptgps/files/patch-crypt__des.ml
diff options
context:
space:
mode:
authorAlexey Dokuchaev <danfe@FreeBSD.org>2021-09-08 08:02:22 +0000
committerAlexey Dokuchaev <danfe@FreeBSD.org>2021-09-08 08:02:23 +0000
commit9f526a5a763e7eb97fe9d039b40b6fa54c806852 (patch)
treea9dd8cdb342287d8cb0a265d4fc10e8d3b4bf999 /security/ocaml-cryptgps/files/patch-crypt__des.ml
parentwww/geneweb: unbreak against safe-by-default strings in OCaml 4.06+. (diff)
security/ocaml-cryptgps: ease transition to post-4.06 OCaml
- Use appropriate data type (Bytes) for mutable strings - Provide more elaborate port description while I'm here Obtained from: Debian
Diffstat (limited to 'security/ocaml-cryptgps/files/patch-crypt__des.ml')
-rw-r--r--security/ocaml-cryptgps/files/patch-crypt__des.ml17
1 files changed, 17 insertions, 0 deletions
diff --git a/security/ocaml-cryptgps/files/patch-crypt__des.ml b/security/ocaml-cryptgps/files/patch-crypt__des.ml
new file mode 100644
index 000000000000..15a5395f51e0
--- /dev/null
+++ b/security/ocaml-cryptgps/files/patch-crypt__des.ml
@@ -0,0 +1,17 @@
+--- crypt_des.ml.orig 2001-03-10 16:43:21 UTC
++++ crypt_des.ml
+@@ -54,12 +54,12 @@ let set_parity key =
+ let l_key = String.length key in
+ if l_key <> 8 then
+ failwith "Crypt_des: invalid key length";
+- let key' = String.copy key in
++ let key' = Bytes.of_string key in
+ for i = 0 to 7 do
+ let k = Char.code key.[i] in
+ key'.[i] <- Char.chr(odd_parity.(k))
+ done;
+- key'
++ Bytes.to_string key'
+ ;;
+
+