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
This commit is contained in:
Andrew Harding
2017-06-02 08:47:50 -06:00
committed by Jeff
parent 28dd155517
commit b90544c9b0
25 changed files with 1053 additions and 736 deletions

View File

@@ -2,20 +2,7 @@
package openssl
/*
#include <openssl/crypto.h>
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/conf.h>
#include <openssl/dh.h>
static long SSL_CTX_set_tmp_dh_not_a_macro(SSL_CTX* ctx, DH *dh) {
return SSL_CTX_set_tmp_dh(ctx, dh);
}
static long PEM_read_DHparams_not_a_macro(SSL_CTX* ctx, DH *dh) {
return SSL_CTX_set_tmp_dh(ctx, dh);
}
*/
// #include "shim.h"
import "C"
import (
@@ -58,7 +45,7 @@ func (c *Ctx) SetDHParameters(dh *DH) error {
runtime.LockOSThread()
defer runtime.UnlockOSThread()
if int(C.SSL_CTX_set_tmp_dh_not_a_macro(c.ctx, dh.dh)) != 1 {
if int(C.X_SSL_CTX_set_tmp_dh(c.ctx, dh.dh)) != 1 {
return errorFromErrorQueue()
}
return nil