cl_verify(3)

cl_verify3

Check whether key and lock strings match with libcanlock

Usage

#include <libcanlock-3/canlock.h>

int cl_verify(cl_hash_version hash,
              const char *c_key_string, const char *c_lock_string);

Supported values for hash (by version 3.0.0 of libcanlock):
CL_SHA1 CL_SHA224 CL_SHA256 CL_SHA384 CL_SHA512

Overview

The cl_verify() function checks whether a <c-key-string> and a <c-lock-string> element according to RFC 8315 matches or not.

The hash algorithm for <scheme> is selected with hash.

The <c-key-string> element is specified with c_key_string and the <c-lock-string> element with c_lock_string.

The function cl_split() can be used to extract <c-key-string> from <c-key> (or <c-lock-string> from <c-lock> respectively) elements.

Consider the function cl_verify_multi() to check multiple keys against multiple locks.

Return value

Upon successful completion zero is returned.
All other values indicate an error.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Authors

Dennis Preiser
(Based in part on the implementation from G. J. Andruk for Version 2)

The base64 implementation is written by Kungliga Tekniska Hogskolan (Royal Institute of Technology, Stockholm, Sweden)

The hash algorithms are implemented with code from RFC 6234

Reporting bugs

Report bugs to <mailto:[email protected]>.

Standards

libcanlock tries to comply with the following standards:

RFC 5537, RFC 6234, RFC 8315

From libcanlock-dev 3.3.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.