#include "bn_lcl.h"
#include <openssl/rand.h>
+static void *dummy=&dummy;
+
+#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
const BIGNUM *add, const BIGNUM *rem,
void (*callback)(int,int,void *), void *cb_arg)
BIGNUM *rnd=NULL;
int found = 0;
- cb.ver = 1;
- cb.arg = cb_arg;
- cb.cb_1 = callback;
+ BN_GENCB_set_old(&cb, callback, cb_arg);
if (ret == NULL)
{
}
else
rnd=ret;
+ bn_verify(rnd);
if(!BN_generate_prime_ex(rnd, bits, safe, add, rem, &cb))
goto err;
found = 1;
err:
if (!found && (ret == NULL) && (rnd != NULL)) BN_free(rnd);
+ if(found) bn_verify(rnd);
return(found ? rnd : NULL);
}
BN_CTX *ctx_passed, void *cb_arg)
{
BN_GENCB cb;
- cb.ver = 1;
- cb.arg = cb_arg;
- cb.cb_1 = callback;
+ BN_GENCB_set_old(&cb, callback, cb_arg);
return BN_is_prime_ex(a, checks, ctx_passed, &cb);
}
int do_trial_division)
{
BN_GENCB cb;
- cb.ver = 1;
- cb.arg = cb_arg;
- cb.cb_1 = callback;
+ BN_GENCB_set_old(&cb, callback, cb_arg);
return BN_is_prime_fasttest_ex(a, checks, ctx_passed,
do_trial_division, &cb);
}
+#endif