Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package ocaml-sha for openSUSE:Leap:16.0 checked in at 2025-04-15 15:14:53 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Leap:16.0/ocaml-sha (Old) and /work/SRC/openSUSE:Leap:16.0/.ocaml-sha.new.1907 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ocaml-sha" Tue Apr 15 15:14:53 2025 rev:2 rq:1254357 version:1.15.4 Changes: -------- --- /work/SRC/openSUSE:Leap:16.0/ocaml-sha/ocaml-sha.changes 2025-03-19 11:52:34.064420321 +0100 +++ /work/SRC/openSUSE:Leap:16.0/.ocaml-sha.new.1907/ocaml-sha.changes 2025-04-15 15:14:57.013899311 +0200 @@ -1,0 +2,6 @@ +Mon Mar 3 03:03:03 UTC 2025 - oher...@suse.de + +- Update to version 1.15.4 + see included CHANGES.md file for details + +------------------------------------------------------------------- Old: ---- ocaml-sha-1.15.2.tar.xz New: ---- ocaml-sha-1.15.4.tar.xz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ocaml-sha.spec ++++++ --- /var/tmp/diff_new_pack.joCjcZ/_old 2025-04-15 15:14:57.337912888 +0200 +++ /var/tmp/diff_new_pack.joCjcZ/_new 2025-04-15 15:14:57.337912888 +0200 @@ -1,7 +1,7 @@ # # spec file for package ocaml-sha # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -25,7 +25,7 @@ %define pkg ocaml-sha Name: %pkg%nsuffix -Version: 1.15.2 +Version: 1.15.4 Release: 0 %{?ocaml_preserve_bytecode} Summary: Binding to the SHA cryptographic functions @@ -36,7 +36,7 @@ BuildRequires: ocaml BuildRequires: ocaml-dune >= 2.9 BuildRequires: ocamlfind(stdlib-shims) -BuildRequires: ocaml-rpm-macros >= 20220222 +BuildRequires: ocaml-rpm-macros >= 20240909 %if "%build_flavor" == "testsuite" BuildRequires: ocamlfind(ounit2) ++++++ _service ++++++ --- /var/tmp/diff_new_pack.joCjcZ/_old 2025-04-15 15:14:57.389915067 +0200 +++ /var/tmp/diff_new_pack.joCjcZ/_new 2025-04-15 15:14:57.405915737 +0200 @@ -1,7 +1,7 @@ <services> - <service name="tar_scm" mode="disabled"> + <service name="tar_scm" mode="manual"> <param name="filename">ocaml-sha</param> - <param name="revision">a3e1e7e2f661e2f33c04c630623a73a94bb0679b</param> + <param name="revision">c743398abee8f822fc0d12f229121e431d60dd5d</param> <param name="scm">git</param> <param name="submodules">disable</param> <param name="url">https://github.com/djs55/ocaml-sha.git</param> @@ -9,10 +9,10 @@ <param name="versionrewrite-pattern">[v]?([^\+]+)(.*)</param> <param name="versionrewrite-replacement">\1</param> </service> - <service name="recompress" mode="disabled"> + <service name="recompress" mode="manual"> <param name="file">*.tar</param> <param name="compression">xz</param> </service> - <service name="set_version" mode="disabled"/> + <service name="set_version" mode="manual"/> </services> ++++++ ocaml-sha-1.15.2.tar.xz -> ocaml-sha-1.15.4.tar.xz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/CHANGES.md new/ocaml-sha-1.15.4/CHANGES.md --- old/ocaml-sha-1.15.2/CHANGES.md 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/CHANGES.md 2023-01-23 21:50:32.000000000 +0100 @@ -1,3 +1,12 @@ +## v1.15.4 + +- Fix build on OCaml 4.02 and fix SHA equality bug by @djs55 (#61) + +## v1.15.3 + +- Fix build on OpenBSD by @kit-ty-kate (#58) +- More unit tests by @c-cube (#57) + ## v1.15.2 - Use modern Bigarray functions by @MisterDA (#55) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/bitfn.h new/ocaml-sha-1.15.4/bitfn.h --- old/ocaml-sha-1.15.2/bitfn.h 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/bitfn.h 2023-01-23 21:50:32.000000000 +0100 @@ -20,6 +20,10 @@ #define BITFN_H #include <stdint.h> +// NOTE: Required to build on OpenBSD +#undef swap32 +#undef swap64 + static inline unsigned int rol32(unsigned int word, unsigned int shift) { return (word << shift) | (word >> (32 - shift)); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/ocaml-sha.changes new/ocaml-sha-1.15.4/ocaml-sha.changes --- old/ocaml-sha-1.15.2/ocaml-sha.changes 1970-01-01 01:00:00.000000000 +0100 +++ new/ocaml-sha-1.15.4/ocaml-sha.changes 2023-01-23 21:50:32.000000000 +0100 @@ -0,0 +1,13 @@ +d4d5b4b make sure tests can actually fail +46f5330 test vectors for SHA256 +870b7f7 add test vectors for SHA +9672f9d Fix build on OpenBSD +cee3205 Merge pull request #58 from kit-ty-kate/fix-openbsd +da7c242 Merge pull request #57 from c-cube/more-tests +b7a090f Update CHANGES.md for v1.15.3 +d829fb6 (tag: v1.15.3) Merge pull request #59 from djs55/prepare-1.15.3 +f5c5f20 Fix equality +0435b10 fix syntax error with 4.02 +eea2999 Merge pull request #61 from djs55/fix-bool +49f2c77 Prepare to release v1.15.4 +c743398 (tag: v1.15.4, origin/master, origin/HEAD) Merge pull request #62 from djs55/prepare.1.15.4 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/sha1_stubs.c new/ocaml-sha-1.15.4/sha1_stubs.c --- old/ocaml-sha-1.15.2/sha1_stubs.c 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/sha1_stubs.c 2023-01-23 21:50:32.000000000 +0100 @@ -179,7 +179,7 @@ { CAMLparam2(t1, t2); int b = memcmp((sha1_digest *) t1, (sha1_digest *) t2, sizeof(sha1_digest)) == 0; - CAMLreturn(Bool_val(b)); + CAMLreturn(Val_bool(b)); } CAMLprim value stub_sha1_of_bin(value bin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/sha256_stubs.c new/ocaml-sha-1.15.4/sha256_stubs.c --- old/ocaml-sha-1.15.2/sha256_stubs.c 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/sha256_stubs.c 2023-01-23 21:50:32.000000000 +0100 @@ -177,7 +177,7 @@ { CAMLparam2(t1, t2); int b = memcmp((sha256_digest *) t1, (sha256_digest *) t2, sizeof(sha256_digest)) == 0; - CAMLreturn(Bool_val(b)); + CAMLreturn(Val_bool(b)); } CAMLprim value stub_sha256_of_bin(value bin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/sha512_stubs.c new/ocaml-sha-1.15.4/sha512_stubs.c --- old/ocaml-sha-1.15.2/sha512_stubs.c 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/sha512_stubs.c 2023-01-23 21:50:32.000000000 +0100 @@ -177,7 +177,7 @@ { CAMLparam2(t1, t2); int b = memcmp((sha512_digest *) t1, (sha512_digest *) t2, sizeof(sha512_digest)) == 0; - CAMLreturn(Bool_val(b)); + CAMLreturn(Val_bool(b)); } CAMLprim value stub_sha512_of_bin(value bin) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/test/dune new/ocaml-sha-1.15.4/test/dune --- old/ocaml-sha-1.15.2/test/dune 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/test/dune 2023-01-23 21:50:32.000000000 +0100 @@ -12,4 +12,4 @@ (alias runtest) (deps sample.txt) (action - (run ./shatest.exe))) + (run ./shatest.exe -verbose))) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/ocaml-sha-1.15.2/test/shatest.ml new/ocaml-sha-1.15.4/test/shatest.ml --- old/ocaml-sha-1.15.2/test/shatest.ml 2022-02-06 19:55:33.000000000 +0100 +++ new/ocaml-sha-1.15.4/test/shatest.ml 2023-01-23 21:50:32.000000000 +0100 @@ -110,6 +110,141 @@ let test_of stringfct_to stringfct_of arr _ = List.iter (fun (s,_) -> assert_equal (stringfct_to s) (stringfct_of s)) arr +(* from: https://www.di-mgt.com.au/sha_testvectors.html *) +module Vectors = struct + type 'a gen = unit -> 'a option + + let sha1str = "sha1", fun s -> Sha1.to_hex (Sha1.string s) + let sha1strg = "sha1", fun g -> + let g = g() in + let ctx = Sha1.init() in + let rec loop () = match g() with + | None -> () + | Some s -> Sha1.update_string ctx s; loop () + in + loop(); + Sha1.to_hex (Sha1.finalize ctx) + + let sha256str = "sha256", fun s -> Sha256.to_hex (Sha256.string s) + let sha256strg = "sha256", fun g -> + let g = g() in + let ctx = Sha256.init() in + let rec loop () = match g() with + | None -> () + | Some s -> Sha256.update_string ctx s; loop () + in + loop(); + Sha256.to_hex (Sha256.finalize ctx) + + let sha512str = "sha512", fun s -> Sha512.to_hex (Sha512.string s) + let sha512strg = "sha512", fun g -> + let g = g() in + let ctx = Sha512.init() in + let rec loop () = match g() with + | None -> () + | Some s -> Sha512.update_string ctx s; loop () + in + loop(); + Sha512.to_hex (Sha512.finalize ctx) + + let gen_repeat n s = + let n = ref n in + fun () -> + if !n=0 then None + else ( + decr n; + Some s + ) + + let test_of ~name pairs ~input : _ list = + List.map + (fun ((hash_name, hash), expect) -> + let test_name = name ^ "_" ^ hash_name in + test_name >:: fun _ctx -> + let res = hash input in + assert_equal ~printer:(Printf.sprintf "%S") expect res) + pairs + + [@@@ocaml.warning "-5"] + + let suite = + "test_vectors" >::: List.flatten [ + test_of ~name:"t1" [ + sha1str, + "a9993e364706816aba3e25717850c26c9cd0d89d"; + sha256str, + "ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad"; + sha512str, + "ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f"; + ] ~input:"abc"; + test_of ~name:"t2" [ + sha1str, +"da39a3ee5e6b4b0d3255bfef95601890afd80709"; + sha256str, + "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"; + sha512str, + "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"; + ] ~input:""; + + test_of ~name:"t3" [ + sha1str, + "84983e441c3bd26ebaae4aa1f95129e5e54670f1"; + sha256str, + "248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1"; + sha512str, + "204a8fc6dda82f0a0ced7beb8e08a41657c16ef468b228a8279be331a703c33596fd15c13b1b07f9aa1d3bea57789ca031ad85c7a71dd70354ec631238ca3445"; + ] ~input: "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; + + test_of ~name:"t4" [ + sha1str, + "a49b2446a02c645bf419f995b67091253a04a259"; + sha256str, + "cf5b16a778af8380036ce59e7b0492370b249b11e8f07a51afac45037afee9d1"; + sha512str, + "8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909"; + ] ~input: + "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu"; + + test_of ~name:"t_Ma_1" [ + sha1strg, + "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; + sha256strg, + "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0"; + sha512strg, + "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"; + ] ~input:(fun() -> gen_repeat 100_000 (String.make 10 'a')); + + test_of ~name:"t_Ma_2" [ + sha1strg, + "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; + sha256strg, + "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0"; + sha512strg, + "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"; + ] ~input:(fun() -> gen_repeat 10_000 (String.make 100 'a')); + + test_of ~name:"t_Ma_3" [ + sha1strg, + "34aa973cd4c4daa4f61eeb2bdbad27316534016f"; + sha256strg, + "cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0"; + sha512strg, + "e718483d0ce769644e2e42c7bc15b4638e1f98b13b2044285632a803afa973ebde0ff244877ea60a4cb0432ce577c31beb009c5c2c49aa2e4eadb217ad8cc09b"; + ] ~input: (fun() -> gen_repeat 1_000_000 (String.make 1 'a')); + + test_of ~name:"t_long" [ + sha1strg, + "7789f0c9ef7bfc40d93311143dfbe69e2017f592"; + sha256strg, + "50e72a0e26442fe2552dc3938ac58658228c0cbfb1d2ca872ae435266fcd055e"; + sha512strg, + "b47c933421ea2db149ad6e10fce6c7f93d0752380180ffd7f4629a712134831d77be6091b819ed352c2967a2e2d4fa5050723c9630691f1a05a7281dbe6c1086"; + ] ~input:(fun() -> gen_repeat 16_777_216 + "abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmno"); + ] + + end + let suite = "SHA binding test" >::: [ "SHA1 example strings" >:: test_strings stringfct_hex_sha1 ex_strings_sha1; @@ -147,6 +282,8 @@ test_of stringfct_bin_sha1 (fun s -> Sha1.(string s |> to_bin |> Bytes.of_string |> of_bin |> to_bin)) ex_strings_sha1; "SHA1 converting from hexadecimal representation" >:: test_of stringfct_hex_sha1 (fun s -> Sha1.(string s |> to_hex |> of_hex |> to_hex)) ex_strings_sha1; + + Vectors.suite; ] -let _ = run_test_tt ~verbose:true suite +let _ = run_test_tt_main suite