2022-08-28 11:11:36 +02:00
|
|
|
//go:build !without_openssl
|
2016-10-04 09:51:14 +02:00
|
|
|
// +build !without_openssl
|
|
|
|
|
2016-05-05 00:02:04 +02:00
|
|
|
package stupidgcm
|
|
|
|
|
|
|
|
// In general, OpenSSL is only threadsafe if you provide a locking function
|
|
|
|
// through CRYPTO_set_locking_callback. However, the GCM operations that
|
|
|
|
// stupidgcm uses never call that function. Additionally, the manual locking
|
|
|
|
// has been removed completely in openssl 1.1.0.
|
|
|
|
|
|
|
|
/*
|
2017-07-14 20:43:12 +02:00
|
|
|
#include <openssl/crypto.h>
|
2016-05-05 00:02:04 +02:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
static void dummy_callback(int mode, int n, const char *file, int line) {
|
|
|
|
printf("stupidgcm: thread locking is not implemented and should not be "
|
|
|
|
"needed. Please upgrade openssl.\n");
|
|
|
|
// panic
|
2016-07-04 08:14:24 +02:00
|
|
|
__builtin_trap();
|
2016-05-05 00:02:04 +02:00
|
|
|
}
|
|
|
|
static void set_dummy_callback() {
|
|
|
|
CRYPTO_set_locking_callback(dummy_callback);
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
C.set_dummy_callback()
|
|
|
|
}
|