1
0
Fork
You've already forked srisum-rs
0
Compute and check subresource integrity digests. https://crates.io/crates/srisum
  • Rust 100%
2023年02月02日 21:47:17 -08:00
.github ci: add cargo-dist support 2023年02月01日 21:28:30 -08:00
src fix(compute): make compute output always be utf8 2023年02月02日 21:38:20 -08:00
.gitignore meta: adding initial project files 2019年06月16日 15:06:07 -07:00
Cargo.lock (cargo-release) start next development iteration 5.0.1-alpha.0 2023年02月02日 21:47:17 -08:00
Cargo.toml (cargo-release) start next development iteration 5.0.1-alpha.0 2023年02月02日 21:47:17 -08:00
CHANGELOG.md docs: update changelog 2023年02月02日 21:45:10 -08:00
cliff.toml feat(modernify): update srisum to get with the times 2022年06月10日 18:27:37 -07:00
CODE_OF_CONDUCT.md meta: add CoC, contributing.md, and improve README 2019年10月20日 20:52:15 -04:00
CONTRIBUTING.md meta: add CoC, contributing.md, and improve README 2019年10月20日 20:52:15 -04:00
LICENSE.md feat(modernify): update srisum to get with the times 2022年06月10日 18:27:37 -07:00
Makefile.toml feat(modernify): update srisum to get with the times 2022年06月10日 18:27:37 -07:00
README.md docs: fix name 2023年02月02日 21:43:45 -08:00

srisum(1) -- compute and check subresource integrity digests

SYNOPSIS

$ srisum [OPTION]... [FILE]...

EXAMPLES

Computing SRI Digests

For a single file:

$ srisum styles.css > styles.css.sri

For multiple different files:

$ srisum styles.css index.js package.json bundle.js > app.sri

From stdin:

$ cat styles.css | srisum -a sha1
sha1-hmkHOZdrfLUVOqpAgryfC8XNGtE -

Specify algorithms to generate:

$ srisum styles.css index.js --algorithms sha512 sha256 sha1 > styles.css.sri

Checking Integrity

Passing checksum file as an argument:

$ srisum -c styles.css.sri
styles.css: OK (sha512)

Passing multiple checksum files:

$ srisum -c styles.css.sri js-files.sri
styles.css: OK (sha512)
index.js: OK (sha512)
lib/util.js: OK (sha512)

Checksum file from stdin:

$ cat styles.css.sri | srisum -c
styles.css: OK (sha512)

Checksum stdin itself:

$ echo "hello" | srisum > stdin.sri
$ echo "hello" | srisum -c stdin.sri
-: OK (sha512)

DESCRIPTION

Print or check Subresource Integrity digests.

Spec: https://w3c.github.io/webappsec/specs/subresourceintegrity/

srisum's API is based on the SHA[N]SUM(1) family of unix utilities.

With no FILE or when FILE is -, read standard input.

-a, --algorithms [ALGO]... - hash algorithms to generate for the FILEs

-c, --check - read SRI sums from the FILEs and check them

-d, --digest-only - only output the digest for each FILE, without filenames

--help - display help and exit

--version - output version information and exit

The following options are useful only when verifying integrity:

--ignore-missing - don't fail or report status for missing files

--quiet - don't print OK for each successfully verified file

--status - don't output anything, status code shows success

-w, --warn - warn about improperly formatted SRI lines

When checking, the input should be a former output of this program. The default mode is to print line with space-separated SRI digests, one more space, and a name for each FILE.

Strict mode, enabled with --strict, will entirely ignore digests (in input and output) that fail all of the following conditions:

  • algorithms must be one or more of: sha1, sha256, sha384, sha512
  • digest strings must be valid RFC4648 Base64 strings.

AUTHOR

Written by Kat Marchán (@zkat)

CONTRIBUTING

The srisum team enthusiastically welcomes contributions and project participation! There's a bunch of things you can do if you want to contribute! The Contributor Guide has all the information you need for everything from reporting bugs to contributing entire new features. Please don't hesitate to jump in if you'd like to, or even ask us questions if something isn't clear.

All participants and maintainers in this project are expected to follow Code of Conduct, and just generally be excellent to each other.

Happy hacking!

LICENSE

This project is licensed under Apache-2.0.