Skip to content

nqrep(3)

nqrepn, nqrepi, nqrepfree — read and free a capsule check report

libnoqtis, -lnoqtis

#include <noqtis.h>

size_t
nqrepn(const nqrep *r);

int
nqrepi(const nqrep *r, size_t i, const char **check, int *ok, const char **detail);

void
nqrepfree(nqrep *r);

A nqrep, made by nqchk(3) or nqchkt(3), holds one row per check, in the order the checks ran. Its layout is private.

() returns the number of rows, or 0 when r is NULL.

() gives row i: *check the check's name, a stable string listed below; *ok 1 when the check passed, 0 when it failed; *detail a UTF-8 text for people (a file's path, what differs). Any of the three output pointers may be NULL. The strings belong to the report and stay valid until nqrepfree().

() frees the report and wipes its memory; NULL is allowed.

noqtis.sig read
it is a JSON object
in canonical form
exactly the seal's fields, with their types
‘noqtis-seal-1’
a known signature algorithm
the context ‘noqtis-capsule-1’
the public key's size
the signature's size
noqtis.json read within the limit
its SHA-256 is the seal's
pinned or not, and whether it matches
the signature over the manifest
the RFC 3161 token
the folder listed
one per listed file
the manifest is a JSON object
in canonical form
exactly the manifest's fields
‘noqtis-capsule-1’ or ‘noqtis-capsule-2’
RFC 3339 UTC
sorted by path, no repeats
format 2: the tree over the entries has the signed root
one per input, with nqchkx(3) lineage folders
what a partial check or a proof left out; never a failure
, key.time
key statements, and a rotated or revoked key's time (nqkstmt(3))
, proof.canonical, proof.fields, proof.entry
a proof's form and each entry's audit path (nqprove(3))
one per refused, non-normal, duplicate or case-colliding path
one per regular file not listed
one per link, special file or refused name

Rows after a failure that makes later checks meaningless are left out (for example, no seal.alg row when seal.format failed). A report never has zero rows.

nqrepi() returns NQOK, or NQEARG when r is NULL or i is not below nqrepn(r).

size_t i;
for (i = 0; i < nqrepn(rep); i++) {
  const char *check, *detail;
  int ok;
  if (nqrepi(rep, i, &check, &ok, &detail) == NQOK)
    printf("%-4s %s: %s\n", ok ? "ok" : "FAIL", check, detail);
}
nqrepfree(rep);

noqtis-check(1), nqchk(3), nqchkt(3)