Commit Graph

9 Commits (c4dc4466d6012e8f7875beb3e68a7dff8bc13152)

Author SHA1 Message Date
Ludovic Courtès dedb5d947e pk-crypto: Fix 'canonical-sexp->sexp' for atoms.
* guix/pk-crypto.scm (canonical-sexp->sexp): Add hack to extract an
  atom's buffer.
* tests/pk-crypto.scm ("sexp->canonical-sexp->sexp"): Add sample.
2013-12-30 22:29:12 +01:00
Ludovic Courtès 36341854df pk-crypto: Work around Libgcrypt bug <https://bugs.g10code.com/gnupg/issue1594>.
* guix/pk-crypto.scm (canonical-sexp-fold): Call 'nth-data' before
  'nth' to work around <https://bugs.g10code.com/gnupg/issue1594>.
* tests/pk-crypto.scm ("https://bugs.g10code.com/gnupg/issue1594"): New
  test.
2013-12-30 22:19:19 +01:00
Ludovic Courtès 9501d7745e pk-crypto: Add canonical-sexp to sexp conversion procedures.
* guix/pk-crypto.scm (canonical-sexp-fold, canonical-sexp->sexp,
  sexp->canonical-sexp): New procedures.
* tests/pk-crypto.scm ("canonical-sexp->sexp",
  "sexp->canonical-sexp->sexp"): New tests.
2013-12-29 15:57:24 +01:00
Ludovic Courtès 363ae1da82 pk-crypto: Add 'canonical-sexp-length' and related procedures.
* guix/pk-crypto.scm (canonical-sexp-length, canonical-sexp-null?,
  canonical-sexp-list?): New procedures.
* tests/pk-crypto.scm ("canonical-sexp-length", "canonical-sexp-list?"):
  New tests.
2013-12-29 15:57:24 +01:00
Ludovic Courtès a2cbbb743d pk-crypto: 'canonical-sexp-nth-data' returns a symbol for "tokens".
* guix/pk-crypto.scm (token-string?): New procedure.
  (canonical-sexp-nth-data): Return a symbol when the element is a
  "token", and a bytevector otherwise.
  (latin1-string->bytevector): Remove.
  (hash-data->bytevector): Adjust accordingly.
* tests/pk-crypto.scm ("canonical-sexp-nth"): Adjust accordingly.  Add
  octet string example.
2013-12-29 15:57:23 +01:00
Ludovic Courtès b0a33ac157 pk-crypto: Rename 'gcry-sexp' to 'canonical-sexp'.
* guix/pk-crypto.scm: Rename procedures, variables, etc. from
  'gcry-sexp' to 'canonical-sexp'.  Add comment with references.
* guix/scripts/authenticate.scm, tests/pk-crypto.scm: Adjust
  accordingly.
2013-12-29 15:57:23 +01:00
Ludovic Courtès 0a66781eee build: Adjust pk-crypto tests to Libgcrypt 1.5.3.
Reported by Andreas Enge <andreas@enge.fr>.

* tests/pk-crypto.scm ("string->gcry-sexp->string"): Remove "#C0FFEE#"
  from SEXPS.
  ("gcry-sexp-nth"): Start at index 1.
2013-12-21 00:10:09 +01:00
Ludovic Courtès ce507041f7 pk-crypto: Add a few sexp utility procedures.
* guix/pk-crypto.scm (gcry-sexp-car, gcry-sexp-cdr, gcry-sexp-nth,
  gcry-sexp-nth-data, dereference-size_t, latin1-string->bytevector,
  hash-data->bytevector): New procedures.
* tests/pk-crypto.scm ("gcry-sexp-car + cdr", "gcry-sexp-nth",
  "gcry-sexp-nth-data", "bytevector->hash-data->bytevector"): New tests.
2013-12-20 15:22:15 +01:00
Ludovic Courtès 3476ded934 Add (guix pk-crypto).
* guix/pk-crypto.scm, tests/pk-crypto.scm: New files.
* Makefile.am (MODULES, SCM_TESTS): Add them.
2013-12-20 00:36:26 +01:00