Commit Graph

13 Commits

Author SHA1 Message Date
Masih H. Derkani
597b8983b0
Address staticcheck issues
Fix `staticcheck` issues:
- S1028 use `fmt.Errorf` to construct formatted errors
- ST1017 yoda conditions
- ST1005 error message capitalization
- ST1006 avoid `self` as receiver name
- S1030 use `buf.String`
- S1011 avoid redundant loop when `append` suffices
- SA4006 unused value
- S1019 remove redundant capacity on `make` call
- SA2002 `t.Fatal` called outside of test

Exported error violates ST1012, which is ignored by this PR since rename may cause breaking changes.

Remove redundant parentheses wrapping, and use CamelCase naming while at it.
2021-07-19 16:53:28 +01:00
Ramesh V Rayaprolu
c2dcc5cca9 avoid panic while encrypting empty data (#109) 2018-10-17 14:33:07 -06:00
Jeff Wendling
9386dd2f5b fix bug with SetPadding and add go.mod 2018-09-05 07:04:03 -06:00
Ramesh Rayaprolu (rarayapr)
33d609e316 add wrappers to enable/disable Padding for encryption contexts 2018-08-17 00:06:36 -06:00
Jeff Wendling
37dddbfb29 add AUTHORS and unify copyright info 2017-06-05 18:07:03 -06:00
Jeff Wendling
0d0212094c remove useless build tags 2017-06-05 18:07:03 -06:00
Andrew Harding
b90544c9b0 openssl 1.1.x support
- created a uniform shim layer for the Go code to invoke that does the
  right thing depending on the version of openssl. functions that have
  yet to be moved can be done so as needed.

- fixed the incorrect use of X509_STORE_CTX_get_app_data in verify_cb to
  pull out the SSL object from the x509 store context, which causes
  crashes when the SSL object index happens to not be zero.

- fix engine not being passed to HMAC_Init_ex

- fix HMAC tests not checking for failures with NewHMAC
2017-06-05 18:07:03 -06:00
paul cannon
d0177cb6a7 Fix init'ing non-authenticated decryption contexts
As pointed out by ishbir in issue 24, the applyKeyAndIV function was
incorrectly always using EVP_EncryptInit_ex(), even when the underlying
context being initialized was for a decryption.

This change causes it to select the right initializer based on the
"encrypt" field in the EVP_CIPHER_CTX. A test is also added which
verifies a fix.

Closes #24.
2014-12-19 02:32:36 -06:00
Ryan Hileman
3945574fd1 restructure certs/keys; add key/cert generation
NID is also now an exposed type
2014-11-18 17:47:07 -08:00
JT Olds
42391d89a5 add license
Change-Id: I4642fb9b97256ec6b3ffbe403272efc690bf1606
2014-05-09 15:38:13 -06:00
Jeff Wendling
1b3b1e773b allow building on default os x
since it doesn't have gcm stuff put it in a conditionally built
file.

Change-Id: I8083ff9b86b6fe0723fd21ffc77038b7679c97c7
2014-04-29 19:26:12 +00:00
Jeff Wendling
a7000f8add space monkey internal commit export
[katamari commit: 40d84e93b0bf20707c02cdbdaec154a0d387043d]
2014-04-28 22:36:29 +00:00
paul cannon
12a1657a95 space monkey internal commit export
[katamari commit: 0a645f84cf1bd058f7533e8eaceba32c75fae90e]
2014-04-25 21:34:29 +00:00