| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | | - |
| 11 | | - |
| 12 | | - |
| 13 | | - |
| 14 | | - |
| 15 | #include <openssl/opensslconf.h> | - |
| 16 | #if OPENSSL_API_COMPAT >= 0x00908000L | - |
| 17 | NON_EMPTY_TRANSLATION_UNIT | - |
| 18 | | - |
| 19 | #else | - |
| 20 | | - |
| 21 | # include <stdio.h> | - |
| 22 | # include <time.h> | - |
| 23 | # include "internal/cryptlib.h" | - |
| 24 | # include <openssl/bn.h> | - |
| 25 | # include <openssl/rsa.h> | - |
| 26 | | - |
| 27 | RSA *RSA_generate_key(int bits, unsigned long e_value, | - |
| 28 | void (*callback) (int, int, void *), void *cb_arg) | - |
| 29 | { | - |
| 30 | int i; | - |
| 31 | BN_GENCB *cb = BN_GENCB_new(); | - |
| 32 | RSA *rsa = RSA_new(); | - |
| 33 | BIGNUM *e = BN_new(); | - |
| 34 | | - |
| 35 | if (cb == NULL || rsa == NULL || e == NULL)| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 36 | goto err; never executed: goto err; | 0 |
| 37 | | - |
| 38 | | - |
| 39 | | - |
| 40 | | - |
| 41 | | - |
| 42 | for (i = 0; i < (int)sizeof(unsigned long) * 8; i++) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 43 | if (e_value & (1UL << i))| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 44 | if (BN_set_bit(e, i) == 0)| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 45 | goto err; never executed: goto err; | 0 |
| 46 | } never executed: end of block | 0 |
| 47 | | - |
| 48 | BN_GENCB_set_old(cb, callback, cb_arg); | - |
| 49 | | - |
| 50 | if (RSA_generate_key_ex(rsa, bits, e, cb)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 51 | BN_free(e); | - |
| 52 | BN_GENCB_free(cb); | - |
| 53 | return rsa; never executed: return rsa; | 0 |
| 54 | } | - |
| 55 | err: code before this statement never executed: err: | 0 |
| 56 | BN_free(e); | - |
| 57 | RSA_free(rsa); | - |
| 58 | BN_GENCB_free(cb); | - |
| 59 | return 0; never executed: return 0; | 0 |
| 60 | } | - |
| 61 | #endif | - |
| | |