Age | Commit message (Collapse) | Author |
|
Various fixes extracted from the abandoned(-for-now?) reuse-cores
branch, principally:
* Change hal_core_alloc*() to support core reuse and to pick the
least-recently-used core of a particular type otherwise;
* Replace assert() and printf() calls with hal_assert() and hal_log(),
respectively. assert() is particularly useless on the HSM, since it
sends its error message into hyperspace then hangs the HSM.
|
|
|
|
structure.
When running multiple concurrent unit tests, I observed multiple failures
in the hmac tests, which I ultimately tracked down to different clients
sharing the same hal_hmac_state struct.
hal_hash_initialize is called twice in hal_hmac_initialize (once to get
the state structure, then again if the supplied key is too long), and is
called in hal_hmac_finalize, to hash the digest with the supplied key. In
these subsequent cases, the caller supplies the state structure, which
hal_hash_initialize zeroes, but it doesn't set the allocated flag. This
marks an in-use struct as available, so it gets reassigned and
reinitialized, and Bad Things Happen for both clients that are trying to
use it.
|
|
|
|
|
|
|
|
Fixes for various minor issues found while integrating with sw/stm32.
Moving the in-memory keystore (PKCS #11 session objects, etc) from the
client library to the HSM was on the near term to-do list in any case,
doing it now turned out to be the easiest way to solve one of the
build problems.
|
|
Find a suitable core, and mark it busy. Don't forget to release it as soon
as you're done. This has a knock-on effect of un-const'ing core arguments
and struct fields in a lot of places, and it moves some core checks around.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Added RPC function to get server version number.
Substantially reworked GNUMakefile with conditionals.
Renamed rpc_*() and xdr_*() to hal_*() for consistency.
Moved hal_io_fmc.c from stm32 repo.
|
|
some unnecessary data copying.
|
|
moment this is all-or-nothing, but could easily be tweaked to allow
compile-time selection of particular hashes.
|
|
|
|
|
|
|
|
pool of pre-configured state blocks, suitable for an embedded system.
|
|
|
|
|
|
Compiles, not yet tested.
|
|
|
|
This required a bit of manual cleanup in hal.h, hash.c, and rsa.c. No
intended changes to functionality provided by parent comments, just a
few tweaks to track API changes beyond git's ken.
|
|
|
|
RSA code; use simpler model (pointer to incomplete structure) used in
ECDSA code. Refactor RSA code to use shared ASN.1 routines.
|
|
where it's unavoidable.
|
|
restore internal state. Compiles, not yet tested.
|
|
|
|
|
|
used the right digest length constants. Doh.
|
|
|
|
passes them. Add missing copyright notices, other trivial cleanup
(whitespace, etc).
|
|
of how long the key is. With this fix, HMAC passes tests on Novena.
|
|
|
|
Main changes: moving the ten zillion core-related constants from
closures into a driver structure, rework API to the more common
initialize/update/finalize because it's easier to understand,
particularly with HMAC.
|
|
|
|
|
|
|
|
numbers, and propegate error codes up from lower layers. Whack
C++-isms, add parenthesese to a lot of macro expressions for
evaluation safety, other minor cleanup.
|