| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/asn1/t_pkey.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int indent) | - | ||||||||||||
| 9 | { | - | ||||||||||||
| 10 | size_t i; | - | ||||||||||||
| 11 | - | |||||||||||||
| 12 | for (i = 0; i < buflen
| 1361-233530 | ||||||||||||
| 13 | if ((
| 16257-217273 | ||||||||||||
| 14 | if (i > 0
| 0-14896 | ||||||||||||
| 15 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 16 | if (!BIO_indent(bp, indent, 128)
| 0-16257 | ||||||||||||
| 17 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 18 | } executed 16257 times by 1 test: end of blockExecuted by:
| 16257 | ||||||||||||
| 19 | - | |||||||||||||
| 20 | - | |||||||||||||
| 21 | - | |||||||||||||
| 22 | - | |||||||||||||
| 23 | if (BIO_printf(bp, "%02x%s", buf[i],
| 0-233530 | ||||||||||||
| 24 | (i == buflen - 1) ? "" : ":") <= 0
| 0-233530 | ||||||||||||
| 25 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 26 | } executed 233530 times by 1 test: end of blockExecuted by:
| 233530 | ||||||||||||
| 27 | if (BIO_write(bp, "\n", 1) <= 0
| 0-1361 | ||||||||||||
| 28 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 29 | return executed 1361 times by 1 test: 1;return 1;Executed by:
executed 1361 times by 1 test: return 1;Executed by:
| 1361 | ||||||||||||
| 30 | } | - | ||||||||||||
| 31 | - | |||||||||||||
| 32 | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, | - | ||||||||||||
| 33 | unsigned char *ign, int indent) | - | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | int n, rv = 0; | - | ||||||||||||
| 36 | const char *neg; | - | ||||||||||||
| 37 | unsigned char *buf = | - | ||||||||||||
| 38 | ((void *)0) | - | ||||||||||||
| 39 | , *tmp = | - | ||||||||||||
| 40 | ((void *)0) | - | ||||||||||||
| 41 | ; | - | ||||||||||||
| 42 | int buflen; | - | ||||||||||||
| 43 | - | |||||||||||||
| 44 | if (num ==
| 216-12101 | ||||||||||||
| 45 | ((void *)0)
| 216-12101 | ||||||||||||
| 46 | ) | - | ||||||||||||
| 47 | return executed 216 times by 1 test: 1;return 1;Executed by:
executed 216 times by 1 test: return 1;Executed by:
| 216 | ||||||||||||
| 48 | neg = BN_is_negative(num)
| 22-12079 | ||||||||||||
| 49 | if (!BIO_indent(bp, indent, 128)
| 0-12101 | ||||||||||||
| 50 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 51 | if (BN_is_zero(num)
| 491-11610 | ||||||||||||
| 52 | if (BIO_printf(bp, "%s 0\n", number) <= 0
| 0-491 | ||||||||||||
| 53 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 54 | return executed 491 times by 1 test: 1;return 1;Executed by:
executed 491 times by 1 test: return 1;Executed by:
| 491 | ||||||||||||
| 55 | } | - | ||||||||||||
| 56 | - | |||||||||||||
| 57 | if (((
| 927-10683 | ||||||||||||
| 58 | if (BIO_printf(bp, "%s %s%lu (%s0x%lx)\n", number, neg,
| 0-10683 | ||||||||||||
| 59 | (unsigned long)bn_get_words(num)[0], neg,
| 0-10683 | ||||||||||||
| 60 | (unsigned long)bn_get_words(num)[0]) <= 0
| 0-10683 | ||||||||||||
| 61 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 62 | return executed 10683 times by 1 test: 1;return 1;Executed by:
executed 10683 times by 1 test: return 1;Executed by:
| 10683 | ||||||||||||
| 63 | } | - | ||||||||||||
| 64 | - | |||||||||||||
| 65 | buflen = ((BN_num_bits(num)+7)/8) + 1; | - | ||||||||||||
| 66 | buf = tmp = CRYPTO_malloc(buflen, __FILE__, 73); | - | ||||||||||||
| 67 | if (buf ==
| 0-927 | ||||||||||||
| 68 | ((void *)0)
| 0-927 | ||||||||||||
| 69 | ) | - | ||||||||||||
| 70 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 71 | buf[0] = 0; | - | ||||||||||||
| 72 | if (BIO_printf(bp, "%s%s\n", number,
| 0-927 | ||||||||||||
| 73 | (neg[0] == '-') ? " (Negative)" : "") <= 0
| 0-927 | ||||||||||||
| 74 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 75 | n = BN_bn2bin(num, buf + 1); | - | ||||||||||||
| 76 | - | |||||||||||||
| 77 | if (buf[1] & 0x80
| 362-565 | ||||||||||||
| 78 | n++; executed 565 times by 1 test: n++;Executed by:
| 565 | ||||||||||||
| 79 | else | - | ||||||||||||
| 80 | tmp++; executed 362 times by 1 test: tmp++;Executed by:
| 362 | ||||||||||||
| 81 | - | |||||||||||||
| 82 | if (ASN1_buf_print(bp, tmp, n, indent + 4) == 0
| 0-927 | ||||||||||||
| 83 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 84 | rv = 1; | - | ||||||||||||
| 85 | err: code before this statement executed 927 times by 1 test: err:Executed by:
| 927 | ||||||||||||
| 86 | CRYPTO_clear_free(buf, buflen, __FILE__, 91); | - | ||||||||||||
| 87 | return executed 927 times by 1 test: rv;return rv;Executed by:
executed 927 times by 1 test: return rv;Executed by:
| 927 | ||||||||||||
| 88 | } | - | ||||||||||||
| Switch to Source code | Preprocessed file |