… | |
… | |
278 | fprintf (stderr, _("generating %d bits key for %s:\n"), bits, node->nodename); |
278 | fprintf (stderr, _("generating %d bits key for %s:\n"), bits, node->nodename); |
279 | |
279 | |
280 | RSA *rsa = RSA_new (); |
280 | RSA *rsa = RSA_new (); |
281 | BIGNUM *e = BN_new (); |
281 | BIGNUM *e = BN_new (); |
282 | BN_set_bit (e, 0); BN_set_bit (e, 16); // 0x10001, 65537 |
282 | BN_set_bit (e, 0); BN_set_bit (e, 16); // 0x10001, 65537 |
|
|
283 | |
|
|
284 | #if OPENSSL_VERSION_NUMBER < 0x10100000 |
283 | BN_GENCB cb; |
285 | BN_GENCB cb; |
284 | BN_GENCB_set (&cb, indicator, 0); |
286 | BN_GENCB_set (&cb, indicator, 0); |
|
|
287 | #else |
|
|
288 | BN_GENCB *cb = BN_GENCB_new (); |
|
|
289 | BN_GENCB_set (cb, indicator, 0); |
|
|
290 | #endif |
285 | |
291 | |
286 | require (RSA_generate_key_ex (rsa, bits, e, &cb)); |
292 | require (RSA_generate_key_ex (rsa, bits, e, &cb)); |
287 | |
293 | |
288 | fprintf (stderr, _("Done.\n")); |
294 | fprintf (stderr, _("Done.\n")); |
289 | |
295 | |