summaryrefslogtreecommitdiff
path: root/src/libotutil/ot-checksum-utils.c
Commit message (Collapse)AuthorAgeFilesLines
* Update FSF license notices to use URL instead of addressJoseph Marrero2021-12-071-3/+1
|
* Add and use ot_checksum_bytes helperAlexander Larsson2020-09-111-0/+10
| | | | This removes some duplicated code (and will be use even more later).
* lib/checksum-utils: Use g_memdup()Colin Walters2019-10-181-3/+2
| | | | This is clearer and silences a scan-build warning.
* libotutil/checksum-utils: Fix memory managementMatthew Leeds2018-03-291-2/+4
| | | | | | | | | | | | | | | Ostree uses the OtChecksum data structure as a wrapper around GChecksum (depending on what libraries are available at compile time). According to the docs for g_checksum_get_digest(), a GChecksum value can no longer be updated after that function is called. Ostree enforces this by setting "initialized" to FALSE after getting the digest, but this leads to ot_checksum_clear() avoiding freeing any memory, leading to leaks. So this commit adds a "closed" value that gets set when getting a digest and checked when updating the value, so the initialized value can be used only for memory management. Closes: #1521 Approved by: jlebon
* Add SPDX-License-Identifier to source filesMarcus Folkesson2018-01-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | SPDX License List is a list of (common) open source licenses that can be referred to by a “short identifier”. It has several advantages compared to the common "license header texts" usually found in source files. Some of the advantages: * It is precise; there is no ambiguity due to variations in license header text * It is language neutral * It is easy to machine process * It is concise * It is simple and can be used without much cost in interpreted environments like java Script, etc. * An SPDX license identifier is immutable. * It provides simple guidance for developers who want to make sure the license for their code is respected See http://spdx.org for further reading. Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com> Closes: #1439 Approved by: cgwalters
* lib/repo: Update summary code to use newer hashing APIColin Walters2017-10-181-11/+0
| | | | | | | And drop the unnecessary wrapper. Closes: #1287 Approved by: jlebon
* libotutil/checksum-utils: fix openssl compilationJonathan Lebon2017-10-111-2/+3
| | | | | Closes: #1261 Approved by: cgwalters
* lib: Add a lighter weight internal checksum wrapperColin Walters2017-10-101-11/+136
| | | | | | | | | | | | | | | | The faster (OpenSSL/GnuTLS) code lived in a `GInputStream` wrapper, and that adds a lot of weight (GObject + vtable calls). Move it into a simple autoptr-struct wrapper, and use it in the metadata path, so we're now using the faster checksums there too. This also drops a malloc there as the new API does hexdigest in place to a buffer. Prep for more work in the commit path to avoid `GInputStream` for local file commits, and ["adopting" files](https://github.com/ostreedev/ostree/pull/1255). Closes: #1256 Approved by: jlebon
* tree-wide: Remove Emacs modelinesColin Walters2017-09-211-2/+1
| | | | | | | | | We added a `.dir-locals.el` in commit: 9a77017d87b74c5e2895cdd64ad098018929403f There's no need to have it per-file, with that people might think to add other editors, which is the wrong direction. Closes: #1206 Approved by: jlebon
* utils/checksum: Port to new code styleColin Walters2017-05-091-40/+18
| | | | | | | Just happened to be reading this code, it's an easy port. Closes: #842 Approved by: jlebon
* libutil: Delete some unused checksum helper APIColin Walters2017-03-301-43/+0
| | | | | | | | This code was last used in 9618232f4da325692dcf98fd6ff5b8abd9fce66c which is sooo old and outdated. Delete. Closes: #767 Approved by: jlebon
* core: Support building with OpenSSL for checksumsColin Walters2017-03-201-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | Add an OpenSSL backend to the checksum input stream, which is where we do a lot of checksumming (object commit, static deltas). The raw OpenSSL performance is [approximately double](https://gist.github.com/cgwalters/169349fd1c06fd4fb4d3a7ce33303222) on my laptop; not only does OpenSSL have e.g. hand-tuned x86_64 assembly, the current implementation uses the [Intel SHA extensions](https://en.wikipedia.org/wiki/Intel_SHA_extensions). Another reason to do this is I was idly thinking about adding [Curve25519](https://en.wikipedia.org/wiki/Curve25519) signatures (like e.g. Alpine does) instead of/in addition to GPG. The rationale for that is that GPG is pretty heavyweight, both in code footprint and the simple fact that EC keys are way smaller. I didn't benchmark ostree with this; we have bigger performance problems really like the fact we just malloc way too much. But, it's a step in the right direction I think in combination with the libcurl work where we're linking to openssl anyways. Closes: #738 Approved by: jlebon
* OstreeSePolicy: add ostree_sepolicy_get_csum()Jonathan Lebon2016-03-251-6/+6
| | | | | | | | | | This can be used as a fingerprint to determine whether two OstreeSePolicy objects are equivalent. Also add documentation for ostree_sepolicy_get_name(). Closes: #219 Approved by: cgwalters
* Use g_autoptr() for GIO object typesMatthew Barnes2015-05-061-1/+1
| | | | | GLib 2.44 supplies all the necessary autocleanup macros for GIO types, and libglnx backports the relevant macros for ostree.
* Use g_autofree instead of gs_freeMatthew Barnes2015-05-061-1/+1
|
* syntax-check: Remove empty lines at the end of fileGiuseppe Scrivano2015-02-021-1/+0
| | | | Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
* checksumutils: Support splicing stream to arbitrary checksum typeColin Walters2015-01-141-1/+1
| | | | | | This will be used later by the metalink code; you can splice with a NULL output stream to an arbitrary GChecksum instead of just a SHA256 one.
* Add repository "summary" file and metalink supportColin Walters2014-09-031-0/+26
| | | | | | | | | | | | | | | | | | | | | | | For Fedora and potentially other distributions which use globally distributed mirrors, metalink is a popular solution to redirect clients to a dynamic set of mirrors. In order to make metalink work though, it needs *one* file which can be checksummed. (Well, potentially we could explode all refs into the metalink.xml, but that would be a lot more invasive, and a bit weird as we'd end up checksumming the checksum file). This commit adds a new command: $ ostree summary -u To regenerate the summary file. Can only be run by one process at a time. After that's done, the metalink can be generated based on it, and the client fetch code will parse and load it. https://bugzilla.gnome.org/show_bug.cgi?id=729585
* Switch to libgsystem local allocation macrosColin Walters2013-07-071-1/+1
| | | | And drop our compatibility wrapper.
* otutil: Move checksum related bits into checksum-utils.[ch]Colin Walters2012-11-291-0/+146
| | | | This paves the way for slimming ot-gio-utils.[ch] into libgsystem.
* core: Clean up checksummingColin Walters2012-04-111-0/+38
Don't expose GChecksum in APIs. Add a new stream class which allows us to pass an input stream somewhere, but gather a checksum as it's read. Move some bits of the internals towards binary csums.