bongo-config compatibility with older GNUTLS 1.0 APIs
This commit is contained in:
@@ -363,7 +363,7 @@ GenerateCryptoData() {
|
||||
gnutls_x509_crt_set_key_usage(certificate, GNUTLS_KEY_DIGITAL_SIGNATURE |
|
||||
GNUTLS_KEY_DATA_ENCIPHERMENT);
|
||||
|
||||
ret = gnutls_x509_crt_sign2(certificate, certificate, key, GNUTLS_DIG_SHA1, 0);
|
||||
ret = GNUTLS_SELF_SIGN(certificate, key);
|
||||
if (ret < 0) {
|
||||
XplConsolePrintf("ERROR: Couldn't self-sign certificate. %s\n", gnutls_strerror(ret));
|
||||
return FALSE;
|
||||
|
||||
@@ -70,4 +70,13 @@ static char *bongo_avirus_config =
|
||||
" \"flags\": 168\n"
|
||||
"}\n";
|
||||
|
||||
/* compat with older gnutls */
|
||||
#ifndef GNUTLS_DIG_SHA1
|
||||
// older GNUTLS
|
||||
# define GNUTLS_SELF_SIGN(c, k) gnutls_x509_crt_sign((c), (c), (k))
|
||||
#elif
|
||||
// new GNUTLS
|
||||
# define GNUTLS_SELF_SIGN(c, k) gnutls_x509_crt_sign2((c), (c), (k), GNUTLS_DIG_SHA1, 0)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user