Skip to content
This repository has been archived by the owner on Sep 30, 2019. It is now read-only.

mvilks/hsm-digest

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Obsolete

Starting from version 2.0.4 of latvia-eid-middleware digest functions have been fixed and now return correct values using both digest methods.

HSM Digest

Prerequisites

Digests

Running

Using SoftHSM2:

python digest.py -lib softhsm -pin 0000

Using eID LV Middleware:

python digest.py -lib otlv -pin 0000

Results

This program uses SHA1 (default) hash function to get digest of three strings. Digests can be checked individually against sha1sum tool:

echo -n "hello world!" | sha1sum

The wrong digests that eID LV Middleware gives are calculated from twice repeated string:

echo -n "hello world!hello world!" | sha1sum

PKCS#11 defines two similar approaches to using message digest functions: using C_Digest or C_DigestUpdate + C_DigestFinal:

C_Digest is equivalent to a sequence of C_DigestUpdate operations followed by C_DigestFinal.

It appears only C_Digest function in eID LV Middleware gives wrong digests.

About

HSM digest tests

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages