https://github.com/fgsch/libvmod-crypto
A Varnish 4 and 5 VMOD to compute message digests and keyed-hash message authentication codes (HMAC).
https://github.com/fgsch/libvmod-crypto
c crypto module varnish vmod
Last synced: 3 months ago
JSON representation
A Varnish 4 and 5 VMOD to compute message digests and keyed-hash message authentication codes (HMAC).
- Host: GitHub
- URL: https://github.com/fgsch/libvmod-crypto
- Owner: fgsch
- License: bsd-2-clause
- Created: 2016-01-26T18:49:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-08T01:17:43.000Z (over 8 years ago)
- Last Synced: 2025-04-06T03:31:50.098Z (6 months ago)
- Topics: c, crypto, module, varnish, vmod
- Language: C
- Homepage:
- Size: 21.5 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
libvmod-crypto
==============[](https://gitter.im/fgsch/libvmod-crypto?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[](https://travis-ci.org/fgsch/libvmod-crypto)## About
A Varnish 4 and 5 VMOD to compute message digests and keyed-hash message
authentication codes (HMAC).For Varnish master refer to the devel branch.
## Requirements
To build this VMOD you will need:
* make
* a C compiler, e.g. GCC or clang
* pkg-config
* python-docutils or docutils in macOS [1]
* libvarnishapi-dev in Debian/Ubuntu, varnish-libs-devel in
CentOS/RedHat or varnish in macOS [1]
* libssl-dev in Debian/Ubuntu, openssl-devel in CentOS/RedHat or
openssl in macOS [1]If you are building from Git, you will also need:
* autoconf
* automake
* libtoolIn addition, to run the tests you will need:
* varnish
If varnish is installed in a non-standard prefix you will also need
to set `PKG_CONFIG_PATH` to the directory where **varnishapi.pc** is
located before running `autogen.sh` and `configure`. For example:```
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
```## Installation
### From a tarball
To install this VMOD, run the following commands:
```
./configure
make
make check
sudo make install
```The `make check` step is optional but it's good to know whether the
tests are passing on your platform.### From the Git repository
To install from Git, clone this repository by running:
```
git clone https://github.com/fgsch/libvmod-crypto
```And then run `./autogen.sh` followed by the instructions above for
installing from a tarball.## Example
```
import crypto;sub vcl_recv {
if (crypto.hmac_sha256("secret",
req.http.host + req.url + req.http.timestamp) != req.http.hmac) {
return (synth(401));
}
}
```## License
This VMOD is licensed under BSD license. See LICENSE for details.
### Note
1. Using Homebrew, https://github.com/Homebrew/brew/.