diff options
| author | Joe Richey <joerichey94@gmail.com> | 2017-08-29 11:17:10 -0700 |
|---|---|---|
| committer | Joe Richey <joerichey94@gmail.com> | 2017-08-29 11:17:10 -0700 |
| commit | 7568ca2aab4a3266eb95cbda64298e2292743c7b (patch) | |
| tree | 03f215c30237515f897c773fe7fbace4634bc48d /crypto/crypto_test.go | |
| parent | a14c0e8b896a1986bbd807ea60e3d7d05f5f6dfc (diff) | |
crypto: Handle when "ulimit -l" is too low
Diffstat (limited to 'crypto/crypto_test.go')
| -rw-r--r-- | crypto/crypto_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
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 { |