Displaying 20 results from an estimated 40 matches for "string_of_csum_t".
2018 Apr 23
3
[PATCH 0/3] v2v: Miscellaneous refactoring and fixes.
Originally an attempt to fix:
https://bugzilla.redhat.com/show_bug.cgi?id=1570407
However this isn't a complete fix. The OVA supplied doesn't even
conform to VMware's own "specification" (I use the word loosely). The
OVF inside the OVA references the disk.vmdk file, but the OVA doesn't
contain that disk.vmdk file, only a snapshot called
disk.vmdk.000000000. Therefore
2016 Sep 30
6
[PATCH 0/4] Consolidate Checksums as common code
Hi,
this small series moves the OCaml Checksums module from virt-builder to
mllib, adding more features to use it also for v2v.
Thanks,
Pino Toscano (4):
mllib: move Checksums from builder
mllib, builder: add and use Checksums.of_string
mllib: add SHA1 support in Checksums
v2v: -i ova: use Checksums
builder/Makefile.am | 2 --
builder/builder.ml | 6 +++-
2015 Jul 28
0
[PATCH 04/10] builder: internally use a list of checksums for indexes
...template did not match the expected checksum!\n found checksum: %s\n expected checksum: %s\nTry:\n - Use the '-v' option and look for earlier error messages.\n - Delete the cache: virt-builder --delete-cache\n - Check no one has tampered with the website or your network!")
(string_of_csum_t csum) csum_actual csum_ref
+
+let verify_checksums checksums filename =
+ List.iter (fun c -> verify_checksum c filename) checksums
diff --git a/builder/checksums.mli b/builder/checksums.mli
index 4dc9dc0..ef26634 100644
--- a/builder/checksums.mli
+++ b/builder/checksums.mli
@@ -23,6 +23,9 @@...
2016 Sep 30
0
[PATCH 1/4] mllib: move Checksums from builder
...d not match the expected checksum!\n found checksum: %s\n expected checksum: %s\nTry:\n - Use the '-v' option and look for earlier error messages.\n - Delete the cache: virt-builder --delete-cache\n - Check no one has tampered with the website or your network!")
+ (Checksums.string_of_csum_t csum) csum_actual (Checksums.string_of_csum csum)
+ )
| { Index.checksums = None } ->
(* Old-style: detached signature. *)
diff --git a/builder/checksums.ml b/builder/checksums.ml
deleted file mode 100644
index c8cdc98..0000000
--- a/builder/checksums.ml
+++ /dev/null
@@ -1,57...
2017 Feb 07
0
[PATCH v2 1/7] mllib: factorize code to add Checksum.get_checksum function
..._checksum (csum, csum_actual))
+ fst (String.split " " line)
+
+let compute_checksum csum_type ?tar filename =
+ do_compute_checksum (of_string csum_type "") ?tar filename
+
+let verify_checksum csum ?tar filename =
+ let csum_ref = string_of_csum csum in
+ let csum_type = string_of_csum_t csum in
+ let csum_actual = compute_checksum csum_type ?tar filename in
+ if csum_ref <> csum_actual then
+ raise (Mismatched_checksum (csum, csum_actual))
let verify_checksums checksums filename =
List.iter (fun c -> verify_checksum c filename) checksums
diff --git a/mllib/chec...
2017 Feb 10
0
[PATCH v3 01/10] mllib: factorize code to add Checksum.get_checksum function
...= fst (String.split " " line) in
- if csum_ref <> csum_actual then
- raise (Mismatched_checksum (csum, csum_actual))
+ let csum_str = fst (String.split " " line) in
+ of_string csum_type csum_str
+
+let verify_checksum csum ?tar filename =
+ let csum_type = string_of_csum_t csum in
+ let csum_actual = compute_checksum csum_type ?tar filename in
+ if csum <> csum_actual then
+ raise (Mismatched_checksum (csum, (string_of_csum csum_actual)))
let verify_checksums checksums filename =
List.iter (fun c -> verify_checksum c filename) checksums
diff --git...
2015 Jul 28
0
[PATCH 02/10] builder: create and use a new Checksums module
...NU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *)
+
+open Common_gettext.Gettext
+open Common_utils
+
+open Utils
+
+open Printf
+
+type csum_t =
+| SHA512 of string
+
+let string_of_csum_t = function
+ | SHA512 _ -> "sha512"
+
+let string_of_csum = function
+ | SHA512 c -> c
+
+let verify_checksum csum filename =
+ let prog, csum_ref =
+ match csum with
+ | SHA512 c -> "sha512sum", c
+ in
+
+ let cmd = sprintf "%s %s" prog (quote file...
2017 Jan 03
0
[PATCH 2/5] mllib: factorize code to add Checksum.get_checksum function
...invalid_arg csum_type
-let verify_checksum csum filename =
- let prog, csum_ref =
- match csum with
- | SHA1 c -> "sha1sum", c
- | SHA256 c -> "sha256sum", c
- | SHA512 c -> "sha512sum", c
- in
-
+let get_checksum csum filename =
+ let prog = (string_of_csum_t csum) ^ "sum" in
let cmd = sprintf "%s %s" prog (Filename.quote filename) in
let lines = external_command cmd in
match lines with
| [] ->
error (f_"%s did not return any output") prog
| line :: _ ->
- let csum_actual = fst (String.split &qu...
2015 Jul 28
19
[PATCH 00/10] RFC: builder: first support for Simple Streams metadata
Hi,
this series adds a basic support for Simple Streams v1.0 metadata
files. This makes it possible to create a repository .conf files with
[cirros]
uri=http://download.cirros-cloud.net
format=simplestreams
to read the latest version of each CirrOS image.
TODO items:
- a bit more testing: listing and creating images works, so the
current metadata is correct
- handle revisions, so newer
2017 Feb 07
1
Re: [PATCH v2 1/7] mllib: factorize code to add Checksum.get_checksum function
...ksum (of_string csum_type "") ?tar filename
Why is there a separate do_compute_checksum function here? It seems
like it is only called from here, not from anywhere else.
> +let verify_checksum csum ?tar filename =
> + let csum_ref = string_of_csum csum in
> + let csum_type = string_of_csum_t csum in
> + let csum_actual = compute_checksum csum_type ?tar filename in
> + if csum_ref <> csum_actual then
> + raise (Mismatched_checksum (csum, csum_actual))
This is technically correct because all the checksum types happen to
be different lengths, but really wrong. You sh...
2015 Jul 28
0
[PATCH 03/10] builder: add SHA256 support in Checksums
...ksums.mli | 1 +
2 files changed, 5 insertions(+)
diff --git a/builder/checksums.ml b/builder/checksums.ml
index 73d541f..25b3328 100644
--- a/builder/checksums.ml
+++ b/builder/checksums.ml
@@ -24,17 +24,21 @@ open Utils
open Printf
type csum_t =
+| SHA256 of string
| SHA512 of string
let string_of_csum_t = function
+ | SHA256 _ -> "sha256"
| SHA512 _ -> "sha512"
let string_of_csum = function
+ | SHA256 c -> c
| SHA512 c -> c
let verify_checksum csum filename =
let prog, csum_ref =
match csum with
+ | SHA256 c -> "sha256sum", c...
2017 Feb 07
0
[PATCH v2 5/7] builder: add Index.write_entry function
...) osinfo;
+ fp "file=%s\n" file_uri;
+ fp "arch=%s\n" arch;
+ may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ may (fp "compressed_size=%Ld\n") compressed_size;
+ may (fp "expand=%s\n") exp...
2017 Feb 10
0
[PATCH v3 08/10] builder: add Index.write_entry function
...) osinfo;
+ fp "file=%s\n" file_uri;
+ fp "arch=%s\n" arch;
+ may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ may (fp "compressed_size=%Ld\n") compressed_size;
+ may (fp "expand=%s\n") exp...
2018 Apr 25
9
[PATCH v2 0/9] v2v: -i ova: Handle OVAs containing snapshots.
https://bugzilla.redhat.com/show_bug.cgi?id=1570407
This turned into quite an in-depth refactoring of how we handle OVAs.
It also fixes a potential security issue.
Rich.
2015 Jul 28
0
[PATCH 06/10] builder: split Index_parser.index in an own module
..."arch=%s\n" arch;
+ (match signature_uri with
+ | None -> ()
+ | Some uri -> fp "sig=%s\n" uri
+ );
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%d\n" revision;
+ (match format with
+ | None -> ()
+ | Some format -> fp "format=%s\n" format
+ );
+ fp "size=%Ld\n" size;
+ (match compressed_size with
+ | None -> ()
+ | Some siz...
2015 Aug 12
0
[PATCH 1/2] builder: add non-int revisions
...l be removed in 1.26 *)
checksums : Checksums.csum_t list option;
- revision : int;
+ revision : Utils.revision;
format : string option;
size : int64;
compressed_size : int64 option;
@@ -86,7 +86,7 @@ let print_entry chan (name, { printable_name = printable_name;
(Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
) checksums
);
- fp "revision=%d\n" revision;
+ fp "revision=%s\n" (string_of_revision revision);
(match format with
| None -> ()
| Some format -> fp "format=%s\n" format
diff --git a/builder/index.mli b/builder/...
2017 Mar 07
0
[PATCH v4 5/9] builder: add Index_parser.write_entry function
...) osinfo;
+ fp "file=%s\n" file_uri;
+ fp "arch=%s\n" arch;
+ may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ may (fp "compressed_size=%Ld\n") compressed_size;
+ may (fp "expand=%s\n") exp...
2017 Sep 18
0
[PATCH v9 4/7] builder: add Index.write_entry function
...) osinfo;
+ fp "file=%s\n" file_uri;
+ fp "arch=%s\n" arch;
+ may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ may (fp "compressed_size=%Ld\n") compressed_size;
+ may (fp "expand=%s\n") exp...
2017 Oct 27
0
[PATCH v11 6/8] builder: add Index.write_entry function
...| Or Some arch -> fp "arch=%s\n" arch
+ | Or None -> ();
+ Option.may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ Option.may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ Option.may (fp "compressed_size=%Ld\n") compressed_size;
+ Option.may (fp "e...
2017 Oct 05
0
[PATCH v11 4/6] builder: add Index.write_entry function
...) osinfo;
+ fp "file=%s\n" file_uri;
+ fp "arch=%s\n" arch;
+ may (fp "sig=%s\n") signature_uri;
+ (match checksums with
+ | None -> ()
+ | Some checksums ->
+ List.iter (
+ fun c ->
+ fp "checksum[%s]=%s\n"
+ (Checksums.string_of_csum_t c) (Checksums.string_of_csum c)
+ ) checksums
+ );
+ fp "revision=%s\n" (string_of_revision revision);
+ may (fp "format=%s\n") format;
+ fp "size=%Ld\n" size;
+ may (fp "compressed_size=%Ld\n") compressed_size;
+ may (fp "expand=%s\n") exp...