From 7568ca2aab4a3266eb95cbda64298e2292743c7b Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Tue, 29 Aug 2017 11:17:10 -0700 Subject: crypto: Handle when "ulimit -l" is too low --- crypto/crypto_test.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'crypto/crypto_test.go') diff --git a/crypto/crypto_test.go b/crypto/crypto_test.go index a069b1b..719db00 100644 --- a/crypto/crypto_test.go +++ b/crypto/crypto_test.go @@ -294,6 +294,20 @@ func TestRandomKeyGen(t *testing.T) { } } +func TestBigKeyGen(t *testing.T) { + key, err := NewRandomKey(4096 * 4096) + switch err { + case nil: + key.Wipe() + return + case ErrKeyLock: + // Don't fail just because "ulimit -l" is too low. + return + default: + t.Fatal(err) + } +} + // didCompress checks if the given data can be compressed. Specifically, it // returns true if running zlib on the provided input produces a shorter output. func didCompress(input []byte) bool { -- cgit v1.2.3