bongo-config compatibility with older GNUTLS 1.0 APIs

This commit is contained in:
alexhudson
2007-07-03 14:19:40 +00:00
parent b2ff8e146d
commit b7aa212182
2 changed files with 10 additions and 1 deletions
+1 -1
View File
@@ -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;
+9
View File
@@ -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