Commit graph

40 commits

Author SHA1 Message Date
Awn Umar
c54ac98328
Add tests for new error interface 2019-08-01 21:43:56 +01:00
Neven Sajko
8750c16425 all: redesign errors in memguard and memguard/core
Memcall is not touched yet. Otherwise this replaces sentinel error
values with IsX exported predicate functions. This enables more
effective error handling by the users and leaves much more freedom for
changing the implementation in the future without breaking API.

Updates #111
2019-08-01 17:12:33 +00:00
Neven Sajko
fb1272668a core: in Wipe and Scramble, keep buf alive after being written to
This is to prevent dead store elimination.

See the discussion at
https://github.com/golang/go/issues/33325 .
2019-07-31 12:55:44 +00:00
Awn Umar
20e9dcd76e
Fix deadlock 2019-07-26 10:22:52 +01:00
Awn Umar
ce6fc55dde
patch: acquire full lock in freeze/melt
Fixes #104
2019-07-26 10:12:56 +01:00
Awn
843870774d
optimise buffer state methods (#103) 2019-07-25 23:01:20 +01:00
Awn
1095ba2fd0
Don't panic on zero size object request (#102) 2019-07-25 22:44:50 +01:00
Awn
36473dda82
Allow callers to specify Coffer re-key cycle interval (#101) 2019-07-21 18:37:26 +01:00
Awn Umar
c92dd46a39
Wipe partition hash after replacing it 2019-07-19 21:09:18 +01:00
Awn Umar
3c5e9f417c
Use fast entropy source for hot paths only 2019-07-18 22:39:14 +01:00
Awn Umar
9494603ee8
Use fast local csprng 2019-07-18 21:34:06 +01:00
Awn Umar
73d5d4fee4
cannot handle mutex contention 2019-07-04 22:02:28 +01:00
Awn Umar
3f4dff4f4a
patch: make immutable buffers mutable before wiping 2019-07-04 20:18:22 +01:00
Awn Umar
a6887c3f44
Remove test that takes far too long 2019-06-27 19:01:28 +01:00
Awn Umar
006bc58c51
Reduce rounds of seal/open test cycle 2019-06-26 21:14:17 +01:00
Awn Umar
188e481ed8
extend tests 2019-06-26 20:06:03 +01:00
Awn Umar
a2fa811a85
canary: remove lower bound limit on length 2019-06-17 19:26:26 +01:00
Awn Umar
eb371074c7
critical: patch error in canary size 2019-06-17 14:35:45 +01:00
Awn Umar
d159150bac
core::purge: test for excluded buffer destruction 2019-06-02 15:32:43 +01:00
Awn Umar
128c283f48
Key from coffer should always be 32 bytes; so panic 2019-06-02 15:23:29 +01:00
Awn Umar
55fa988242
Wipe before removing from list; so that purge still catches it 2019-06-02 15:00:52 +01:00
Awn Umar
a31b3b4446
docs: updates for clarity and readability 2019-05-30 10:04:45 +01:00
Awn Umar
3ea58f31a7
remove clone; implement tests and repr methods 2019-05-26 19:08:26 +01:00
Awn Umar
520d091282
patch: if purge called, subsequent exit/panic would not wipe keys 2019-05-21 18:07:34 +01:00
Awn Umar
61e6b4f8d7
feature: add clone and {move/copy}at methods 2019-05-17 14:22:12 +01:00
Awn Umar
5094398556
make buffer list private & modify slice type cast behaviour 2019-05-15 17:47:28 +01:00
Awn Umar
9fa7db65b9
revert: custom entropy pool
Seemed like a good idea but further tests revealed that it only behaved well with low buffer sizes. As the size of the given buffer increased, the performance of Scramble degraded way faster than the equivalent rand.Read call did.
2019-05-14 15:13:30 +01:00
Awn Umar
60cf168a6e
Prefer panic to nil returns 2019-05-14 11:41:31 +01:00
Awn Umar
3c486c6cb9
Use variable length canaries with 32 <= len(canary) <= ~pagesize 2019-05-13 17:27:12 +01:00
Awn Umar
8265a2536d
crypto: use local custom emtropy pool 2019-05-13 17:08:37 +01:00
Awn Umar
a684db30dc
Make data field unexported in core; use method instead 2019-05-13 02:45:54 +01:00
Awn Umar
63466f748b
Move canary reference value 2019-05-03 05:11:22 +01:00
Awn Umar
c93b1b069c
patchset: some changes and streamlining
There are some known issues in this code at the moment and parts of the frontend API exist have not yet been stabalised or tested.
2019-05-01 18:13:17 +01:00
Awn Umar
e750c0917d
Patch test failure 2019-03-22 22:30:14 +00:00
Awn Umar
c6e96427c3
Simplify errors 2019-03-22 22:25:20 +00:00
Awn Umar
8740253ea8
some improvements to errors 2019-03-21 22:28:44 +00:00
Awn Umar
5ec2b2fbe5
refactor: move buffer related functions into method fold 2019-03-21 20:30:09 +00:00
Awn Umar
5583953cd7
Port a bunch more things. Still need to work on Enclaves and writing tests and examples and docs. 2019-03-21 18:58:07 +00:00
Awn Umar
a6ccf280ec
api: ported data representation api and implemented basic seal/open functionality in frontend
Still need to write tests.
2019-03-21 05:34:28 +00:00
Awn Umar
fbef9a3b39 Rewrite and refactor. Core functionality moved to submodule. Many fixes and improvements. Todo: re-write frontend 2019-02-24 19:52:41 +00:00