diff options
author | Geoff Thorpe <geoff@openssl.org> | 2002-12-08 16:45:26 +0000 |
---|---|---|
committer | Geoff Thorpe <geoff@openssl.org> | 2002-12-08 16:45:26 +0000 |
commit | e189872486477c2bb9b041cb00f4390ef4aa911b (patch) | |
tree | d5a3ad328351adddf360315937074087669ee83d /crypto/bn/bn.h | |
parent | fdaea9ed2e5644b98baae983ce7a55100c956999 (diff) |
Nils Larsch submitted;
- a patch to fix a memory leak in rsa_gen.c
- a note about compiler warnings with unions
- a note about improving structure element names
This applies his patch and implements a solution to the notes.
Diffstat (limited to 'crypto/bn/bn.h')
-rw-r--r-- | crypto/bn/bn.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/crypto/bn/bn.h b/crypto/bn/bn.h index c1b5b41935..58263baf9a 100644 --- a/crypto/bn/bn.h +++ b/crypto/bn/bn.h @@ -299,10 +299,22 @@ struct bn_gencb_st void (*cb_1)(int, int, void *); /* if(ver==2) - new callback style */ int (*cb_2)(int, int, BN_GENCB *); - }; + } cb; }; /* Wrapper function to make using BN_GENCB easier, */ int BN_GENCB_call(BN_GENCB *cb, int a, int b); +/* Macro to populate a BN_GENCB structure with an "old"-style callback */ +#define BN_GENCB_set_old(gencb, callback, cb_arg) { \ + BN_GENCB *tmp_gencb = (gencb); \ + tmp_gencb->ver = 1; \ + tmp_gencb->arg = (cb_arg); \ + tmp_gencb->cb.cb_1 = (callback); } +/* Macro to populate a BN_GENCB structure with a "new"-style callback */ +#define BN_GENCB_set(gencb, callback, cb_arg) { \ + BN_GENCB *tmp_gencb = (gencb); \ + tmp_gencb->ver = 2; \ + tmp_gencb->arg = (cb_arg); \ + tmp_gencb->cb.cb_2 = (callback); } #define BN_prime_checks 0 /* default: select number of iterations based on the size of the number */ |