Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-crypto
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvmod-crypto
Commits
a1e61657
Commit
a1e61657
authored
Oct 27, 2018
by
Nils Goroll
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test
parent
a38d3232
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
156 additions
and
80 deletions
+156
-80
vmod_crypto.md
src/vmod_crypto.md
+78
-1
vmod_crypto.md
src/vmod_crypto.md
+78
-1
vmod_crypto.vcc
src/vmod_crypto.vcc
+0
-78
No files found.
src/vmod_crypto.md
deleted
120000 → 0
View file @
a38d3232
vmod_crypto.vcc
\ No newline at end of file
src/vmod_crypto.md
0 → 100644
View file @
a1e61657
#-
# Copyright 2018 UPLEX Nils Goroll Systemoptimierung
# All rights reserved
#
# Author: Nils Goroll <nils.goroll@uplex.de>
#
# See LICENSE
#
$Module crypto 3 Varnish crypto Module
DESCRIPTION
===========
This vmod provides VCL access to cryptographic functions from the
_crypt_
library.
Example
::
import crypto;
sub vcl_init {
new v = crypto.verifier(sha256, {"
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
"});
}
sub vcl_deliver {
if (! v.update("data")) {
return (synth(500, "vmod_crypto error"));
}
if (! v.valid(blob.encode(BASE64URLNOPAD, "base64"))) {
return (synth(400, "invalid signature"));
}
}
} -start
$Object verifier(ENUM {md_null, md4, md5, sha1, sha224,
sha256, sha384, sha512, ripemd160, rmd160, whirlpool} digest,
STRING key)
Create an object to verify signatures created using _digest_ and
_key_
.
The _key_ argument is a PEM-encoded public key specification.
The cryptographic method to be used and the key length are
automatically determined from _key_. Typically supported methods
comprise RSA and DSA.
$Method BOOL .update(STRING_LIST)
Add strings to the data to be verfied with the verifier object.
$Method BOOL .update_blob(BLOB)
Add a blob to the data to be verified with the verifier object.
$Method BOOL .reset()
Reset the verfication state as if previous calls to the update methods
had not happened.
$Method BOOL .valid(BLOB signature)
Check if _signature_ is a valid signature for the _verifier_ object
given the previous updates.
Note that after calling .valid(), .update can be called again to add
additional data, which can then be validated against a (different)
signature using another call to .valid().
SEE ALSO
========vcl
\(
7),varnishd
\(
1)
src/vmod_crypto.vcc
deleted
100644 → 0
View file @
a38d3232
#-
# Copyright 2018 UPLEX Nils Goroll Systemoptimierung
# All rights reserved
#
# Author: Nils Goroll <nils.goroll@uplex.de>
#
# See LICENSE
#
$Module crypto 3 Varnish crypto Module
DESCRIPTION
===========
This vmod provides VCL access to cryptographic functions from the
_crypt_ library.
Example
::
import crypto;
sub vcl_init {
new v = crypto.verifier(sha256, {"
-----BEGIN PUBLIC KEY-----
...
-----END PUBLIC KEY-----
"});
}
sub vcl_deliver {
if (! v.update("data")) {
return (synth(500, "vmod_crypto error"));
}
if (! v.valid(blob.encode(BASE64URLNOPAD, "base64"))) {
return (synth(400, "invalid signature"));
}
}
} -start
$Object verifier(ENUM {md_null, md4, md5, sha1, sha224,
sha256, sha384, sha512, ripemd160, rmd160, whirlpool} digest,
STRING key)
Create an object to verify signatures created using _digest_ and
_key_.
The _key_ argument is a PEM-encoded public key specification.
The cryptographic method to be used and the key length are
automatically determined from _key_. Typically supported methods
comprise RSA and DSA.
$Method BOOL .update(STRING_LIST)
Add strings to the data to be verfied with the verifier object.
$Method BOOL .update_blob(BLOB)
Add a blob to the data to be verified with the verifier object.
$Method BOOL .reset()
Reset the verfication state as if previous calls to the update methods
had not happened.
$Method BOOL .valid(BLOB signature)
Check if _signature_ is a valid signature for the _verifier_ object
given the previous updates.
Note that after calling .valid(), .update can be called again to add
additional data, which can then be validated against a (different)
signature using another call to .valid().
SEE ALSO
========vcl\(7),varnishd\(1)
Nils Goroll
@slink
mentioned in commit
dafef11d
·
May 30, 2019
mentioned in commit
dafef11d
mentioned in commit dafef11d9d98e021e828ba1a97aa4e81caf6a637
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment