Commit Graph

25 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
Adin Schmahmann
f4030af720 refactor: make Ed25519 keys less special cased 2020-07-29 16:49:19 -04:00
Steven Allen
f99684446c feat: add Size function to PublicKey
This allows us to determine the size of signatures produced by a public key.
Incidentally, this also allows us to determine the size of an RSA key's modulus.
2019-10-21 15:24:42 -07:00
dignifiedquire
80f7894f83 feat: add Equal method to compare keys
Closes #125
2019-06-28 13:37:09 +02:00
Jeff Wendling
a66df3e4f5 change ulong to size_t to match shim.h 2018-09-13 17:23:02 -06:00
Jeff Wendling
0ffbced908 skip ed25519 tests if not supported 2018-09-13 16:17:59 -06:00
parasssh
8ea58d1789 Ed25519 key support (#103)
* ed gen, sign, verify works. tested25519 fails
* Ignore some unit tests in ED since it relies on GoLang lib to support Ed keys
* Cleanup sign and verify operations
* Cleanup and prettify
* cleanups
* Conditional X_EVP_PKEY_ED25519 and  X_EVP_Digest{Sign|Verify}[Init] based on openssl version.
2018-09-13 16:07:17 -06:00
Christopher Dudley
08c83c41f3 Fix spelling of some NID constants. 2018-01-05 16:06:15 -07:00
Christopher Dudley
4dc321d35e Fix incompatibilities with OpenSSL 1.0.x (#1)
Fix incompatiblities with OpenSSL 1.0.x
2018-01-05 16:06:15 -07:00
Christopher Dudley
96ce3e554e Rename Type() to KeyType() to be more descriptive. 2018-01-05 16:06:15 -07:00
Christopher Dudley
c26b4563dc change error checking style to match existing code. 2018-01-05 16:06:15 -07:00
Christopher Dudley
64a7b8acc3 add EC key generation. 2018-01-05 16:06:15 -07:00
Christopher Dudley
1647be123d allow pKey to support any key type supported by OpenSSL. 2018-01-05 16:06:15 -07: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
Stephen Gallagher
28dd155517 Fix typo in LoadPrivateKeyFromPEMWidthPassword
Fixes #62
2017-04-14 09:50:34 -06:00
Colin Misare
a0b9b65330 adding GenerateRSAKeyWithExponent 2016-08-09 18:51:09 -06:00
Colin Misare
2ffbf8f57a adding LoadPrivateKeyFromDER 2016-08-09 18:51:05 -06:00
Colin Misare
ef69faf59b adding SHA1 and SHA512 Methods 2016-05-17 17:38:34 -06:00
JT Olds
e6f40e41ef fix a leak and compiler error 2015-11-29 11:45:32 -07:00
Giulio
730bda13bd added LoadPrivateKeyFromPEMWidthPassword method to permit the load of private key with password 2015-05-20 12:03:47 +02:00
Scott J. Goldman
dfb921e960 fix compilation for later openssl
in later openssl, the key param in EVP_PKEY_assign changed from char* to
void*. causes this error:
../github.com/spacemonkeygo/openssl/key.go:324: cannot use
(*C.char)(unsafe.Pointer(rsa)) (type *C.char) as type unsafe.Pointer in
argument to _Cfunc_EVP_PKEY_assign
2015-02-24 05:33:55 -05:00
Carlos Martín Nieto
20fdb1c664 Work with versions pickier about C types
Newer versions of Go (at least 1.4) do not like mixing C pointer
types. Cast an unsafe.Pointer to *C.char to make the compiler see
matching types.
2014-12-12 09:15:49 +01: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