package rfc6287

  1. Overview
  2. Docs
RFC6287 OCRA (OATH Challenge-Response Algorithm)

Install

Dune Dependency

Authors

Maintainers

Sources

1.0.3.tar.gz
md5=1d543e3d6ccad89994bc906b0d6ef809

Description

Published: 16 Mar 2018

README

ocaml-rfc6287

OCaml implementation of RFC6287 OCRA (OATH Challenge-Response Algorithm) incl. RFC Errata ID: 3729

Notes on bisect and ounit tests

$ ocaml pkg/pkg.ml build --tests true --with-coverage true
$ ocaml pkg/pkg.ml test
$ bisect-ppx-report -text - bisect*.out

Example usage

enable and build ocra_tool example

$ ocaml pkg/pkg.ml build --with-examples true

create credential files for client and server (server has a counter window of 5)

$ S=OCRA-1:HOTP-SHA1-6:C-QN08-PSHA1
$ K=0x00112233445566778899aabbccddeeff00112233
$ P=1234
$ C=0
$ ./_build/examples/ocra_tool.native init -f /tmp/client.ocra -s $S -k $K -p $P -c $C
$ ./_build/examples/ocra_tool.native info
suite:            OCRA-1:HOTP-SHA1-6:C-QN08-PSHA1
key:              0x00112233445566778899aabbccddeeff00112233
counter:          0x0
pinhash:          0x7110eda4d09e062aa5e4a390b0a572ac0d2c0220

$ ./_build/examples/ocra_tool.native init -f /tmp/server.ocra -s $S -k $K -p $P -c $C -w 5
$ ./_build/examples/ocra_tool.native info -f /tmp/server.ocra
suite:            OCRA-1:HOTP-SHA1-6:C-QN08-PSHA1
key:              0x00112233445566778899aabbccddeeff00112233
counter:          0x0
pinhash:          0x7110eda4d09e062aa5e4a390b0a572ac0d2c0220
counter_window:   5

generate challenge (server), calculate response (client) and verify (server).

counter values in credential files have been incremented

$ Q=`./_build/examples/ocra_tool.native challenge -f /tmp/server.ocra`
$ A=`./_build/examples/ocra_tool.native response -f /tmp/client.ocra -q $Q`
$ ./_build/examples/ocra_tool.native verify -f /tmp/server.ocra -q $Q -a $A
success

$ ./_build/examples/ocra_tool.native info -f /tmp/server.ocra
suite:            OCRA-1:HOTP-SHA1-6:C-QN08-PSHA1
key:              0x00112233445566778899aabbccddeeff00112233
counter:          0x1
pinhash:          0x7110eda4d09e062aa5e4a390b0a572ac0d2c0220
counter_window:   5
$ ./_build/examples/ocra_tool.native info -f /tmp/client.ocra
suite:            OCRA-1:HOTP-SHA1-6:C-QN08-PSHA1
key:              0x00112233445566778899aabbccddeeff00112233
counter:          0x1
pinhash:          0x7110eda4d09e062aa5e4a390b0a572ac0d2c0220

Dependencies (9)

  1. rresult
  2. hex
  3. astring
  4. cstruct >= "1.7.0"
  5. nocrypto >= "0.5.1"
  6. topkg build
  7. ocamlbuild build
  8. ocamlfind build
  9. ocaml >= "4.03.0"

Dev Dependencies (2)

  1. bisect_ppx with-test & < "2.0.0"
  2. ounit with-test

Used by

None

Conflicts

None