go-openssl/verify.c
Andrew Harding 420209b5b2 space monkey internal commit export
[katamari commit: ec10a16bdc8a55c53af32481120946fa49570b30]
2014-03-11 18:09:47 +00:00

12 lines
398 B
C

#include <openssl/ssl.h>
#include "_cgo_export.h"
#include <stdio.h>
int verify_cb(int ok, X509_STORE_CTX* store) {
SSL* ssl = (SSL *)X509_STORE_CTX_get_app_data(store);
SSL_CTX* ssl_ctx = ssl_ctx = SSL_get_SSL_CTX(ssl);
void* p = SSL_CTX_get_ex_data(ssl_ctx, get_ssl_ctx_idx());
// get the pointer to the go Ctx object and pass it back into the thunk
return verify_cb_thunk(p, ok, store);
}