2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 14:07:59 +00:00

silence compiler warnings. [RT #20472]

This commit is contained in:
Mark Andrews 2009-10-30 05:08:23 +00:00
parent e98e7e6680
commit 8a0943e125
3 changed files with 46 additions and 15 deletions

View File

@ -31,7 +31,7 @@
/*
* Principal Author: Brian Wellington
* $Id: openssldh_link.c,v 1.17 2009/10/24 09:46:19 fdupont Exp $
* $Id: openssldh_link.c,v 1.18 2009/10/30 05:08:23 marka Exp $
*/
#ifdef OPENSSL
@ -153,11 +153,16 @@ openssldh_paramcompare(const dst_key_t *key1, const dst_key_t *key2) {
static int
progress_cb(int p, int n, BN_GENCB *cb)
{
void (*callback)(int) = cb->arg;
union {
void *dptr;
void (*fptr)(int);
} u;
UNUSED(n);
if (callback != NULL)
callback(p);
u.dptr = cb->arg;
if (u.fptr != NULL)
u.fptr(p);
return (1);
}
#endif
@ -167,6 +172,10 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
DH *dh = NULL;
#if OPENSSL_VERSION_NUMBER > 0x00908000L
BN_GENCB cb;
union {
void *dptr;
void (*fptr)(int);
} u;
#else
UNUSED(callback);
@ -200,7 +209,8 @@ openssldh_generate(dst_key_t *key, int generator, void (*callback)(int)) {
if (callback == NULL) {
BN_GENCB_set_old(&cb, NULL, NULL);
} else {
BN_GENCB_set(&cb, &progress_cb, callback);
u.fptr = callback;
BN_GENCB_set(&cb, &progress_cb, u.dptr);
}
if (!DH_generate_parameters_ex(dh, key->key_size, generator,

View File

@ -29,7 +29,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: openssldsa_link.c,v 1.17 2009/10/24 09:46:19 fdupont Exp $ */
/* $Id: openssldsa_link.c,v 1.18 2009/10/30 05:08:23 marka Exp $ */
#ifdef OPENSSL
#ifndef USE_EVP
@ -317,11 +317,16 @@ openssldsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
static int
progress_cb(int p, int n, BN_GENCB *cb)
{
void (*callback)(int) = cb->arg;
union {
void *dptr;
void (*fptr)(int);
} u;
UNUSED(n);
if (callback != NULL)
callback(p);
u.dptr = cb->arg;
if (u.fptr != NULL)
u.fptr(p);
return (1);
}
#endif
@ -333,8 +338,13 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
isc_result_t result;
#if OPENSSL_VERSION_NUMBER > 0x00908000L
BN_GENCB cb;
union {
void *dptr;
void (*fptr)(int);
} u;
#else
UNUSED(callback);
#endif
UNUSED(unused);
@ -352,7 +362,8 @@ openssldsa_generate(dst_key_t *key, int unused, void (*callback)(int)) {
if (callback == NULL) {
BN_GENCB_set_old(&cb, NULL, NULL);
} else {
BN_GENCB_set(&cb, &progress_cb, callback);
u.fptr = callback;
BN_GENCB_set(&cb, &progress_cb, u.dptr);
}
if (!DSA_generate_parameters_ex(dsa, key->key_size, rand_array,

View File

@ -17,7 +17,7 @@
/*
* Principal Author: Brian Wellington
* $Id: opensslrsa_link.c,v 1.36 2009/10/28 21:07:09 marka Exp $
* $Id: opensslrsa_link.c,v 1.37 2009/10/30 05:08:23 marka Exp $
*/
#ifdef OPENSSL
#include <config.h>
@ -708,11 +708,16 @@ opensslrsa_compare(const dst_key_t *key1, const dst_key_t *key2) {
static int
progress_cb(int p, int n, BN_GENCB *cb)
{
void (*callback)(int) = cb->arg;
union {
void *dptr;
void (*fptr)(int);
} u;
UNUSED(n);
if (callback != NULL)
callback(p);
u.dptr = cb->arg;
if (u.fptr != NULL)
u.fptr(p);
return (1);
}
#endif
@ -721,6 +726,10 @@ static isc_result_t
opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
#if OPENSSL_VERSION_NUMBER > 0x00908000L
BN_GENCB cb;
union {
void *dptr;
void (*fptr)(int);
} u;
RSA *rsa = RSA_new();
BIGNUM *e = BN_new();
#if USE_EVP
@ -749,7 +758,8 @@ opensslrsa_generate(dst_key_t *key, int exp, void (*callback)(int)) {
if (callback == NULL) {
BN_GENCB_set_old(&cb, NULL, NULL);
} else {
BN_GENCB_set(&cb, &progress_cb, callback);
u.fptr = callback;
BN_GENCB_set(&cb, &progress_cb, u.dptr);
}
if (RSA_generate_key_ex(rsa, key->key_size, e, &cb)) {