| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/ct/ct_policy.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | - | |||||||
| 5 | - | |||||||
| 6 | - | |||||||
| 7 | - | |||||||
| 8 | - | |||||||
| 9 | - | |||||||
| 10 | static const time_t SCT_CLOCK_DRIFT_TOLERANCE = 300; | - | ||||||
| 11 | - | |||||||
| 12 | CT_POLICY_EVAL_CTX *CT_POLICY_EVAL_CTX_new(void) | - | ||||||
| 13 | { | - | ||||||
| 14 | CT_POLICY_EVAL_CTX *ctx = CRYPTO_zalloc(sizeof(CT_POLICY_EVAL_CTX), __FILE__, 30); | - | ||||||
| 15 | - | |||||||
| 16 | if (ctx ==
| 0-15 | ||||||
| 17 | ((void *)0)
| 0-15 | ||||||
| 18 | ) { | - | ||||||
| 19 | ERR_put_error(50,(133),((1|64)),__FILE__,33); | - | ||||||
| 20 | return never executed: return ((void *)0) ;never executed: return ((void *)0) ; | 0 | ||||||
| 21 | ((void *)0) never executed: return ((void *)0) ; | 0 | ||||||
| 22 | ; never executed: return ((void *)0) ; | 0 | ||||||
| 23 | } | - | ||||||
| 24 | - | |||||||
| 25 | - | |||||||
| 26 | ctx->epoch_time_in_ms = (uint64_t)(time( | - | ||||||
| 27 | ((void *)0) | - | ||||||
| 28 | ) + SCT_CLOCK_DRIFT_TOLERANCE) * | - | ||||||
| 29 | 1000; | - | ||||||
| 30 | - | |||||||
| 31 | return executed 15 times by 1 test: ctx;return ctx;Executed by:
executed 15 times by 1 test: return ctx;Executed by:
| 15 | ||||||
| 32 | } | - | ||||||
| 33 | - | |||||||
| 34 | void CT_POLICY_EVAL_CTX_free(CT_POLICY_EVAL_CTX *ctx) | - | ||||||
| 35 | { | - | ||||||
| 36 | if (ctx ==
| 0-15 | ||||||
| 37 | ((void *)0)
| 0-15 | ||||||
| 38 | ) | - | ||||||
| 39 | return; never executed: return; | 0 | ||||||
| 40 | X509_free(ctx->cert); | - | ||||||
| 41 | X509_free(ctx->issuer); | - | ||||||
| 42 | CRYPTO_free(ctx, __FILE__, 50); | - | ||||||
| 43 | } executed 15 times by 1 test: end of blockExecuted by:
| 15 | ||||||
| 44 | - | |||||||
| 45 | int CT_POLICY_EVAL_CTX_set1_cert(CT_POLICY_EVAL_CTX *ctx, X509 *cert) | - | ||||||
| 46 | { | - | ||||||
| 47 | if (!X509_up_ref(cert)
| 0-12 | ||||||
| 48 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 49 | ctx->cert = cert; | - | ||||||
| 50 | return executed 12 times by 1 test: 1;return 1;Executed by:
executed 12 times by 1 test: return 1;Executed by:
| 12 | ||||||
| 51 | } | - | ||||||
| 52 | - | |||||||
| 53 | int CT_POLICY_EVAL_CTX_set1_issuer(CT_POLICY_EVAL_CTX *ctx, X509 *issuer) | - | ||||||
| 54 | { | - | ||||||
| 55 | if (!X509_up_ref(issuer)
| 0-12 | ||||||
| 56 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||
| 57 | ctx->issuer = issuer; | - | ||||||
| 58 | return executed 12 times by 1 test: 1;return 1;Executed by:
executed 12 times by 1 test: return 1;Executed by:
| 12 | ||||||
| 59 | } | - | ||||||
| 60 | - | |||||||
| 61 | void CT_POLICY_EVAL_CTX_set_shared_CTLOG_STORE(CT_POLICY_EVAL_CTX *ctx, | - | ||||||
| 62 | CTLOG_STORE *log_store) | - | ||||||
| 63 | { | - | ||||||
| 64 | ctx->log_store = log_store; | - | ||||||
| 65 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||
| 66 | - | |||||||
| 67 | void CT_POLICY_EVAL_CTX_set_time(CT_POLICY_EVAL_CTX *ctx, uint64_t time_in_ms) | - | ||||||
| 68 | { | - | ||||||
| 69 | ctx->epoch_time_in_ms = time_in_ms; | - | ||||||
| 70 | } executed 14 times by 1 test: end of blockExecuted by:
| 14 | ||||||
| 71 | - | |||||||
| 72 | X509* CT_POLICY_EVAL_CTX_get0_cert(const CT_POLICY_EVAL_CTX *ctx) | - | ||||||
| 73 | { | - | ||||||
| 74 | return never executed: ctx->cert;return ctx->cert;never executed: return ctx->cert; | 0 | ||||||
| 75 | } | - | ||||||
| 76 | - | |||||||
| 77 | X509* CT_POLICY_EVAL_CTX_get0_issuer(const CT_POLICY_EVAL_CTX *ctx) | - | ||||||
| 78 | { | - | ||||||
| 79 | return never executed: ctx->issuer;return ctx->issuer;never executed: return ctx->issuer; | 0 | ||||||
| 80 | } | - | ||||||
| 81 | - | |||||||
| 82 | const CTLOG_STORE *CT_POLICY_EVAL_CTX_get0_log_store(const CT_POLICY_EVAL_CTX *ctx) | - | ||||||
| 83 | { | - | ||||||
| 84 | return never executed: ctx->log_store;return ctx->log_store;never executed: return ctx->log_store; | 0 | ||||||
| 85 | } | - | ||||||
| 86 | - | |||||||
| 87 | uint64_t CT_POLICY_EVAL_CTX_get_time(const CT_POLICY_EVAL_CTX *ctx) | - | ||||||
| 88 | { | - | ||||||
| 89 | return executed 1 time by 1 test: ctx->epoch_time_in_ms;return ctx->epoch_time_in_ms;Executed by:
executed 1 time by 1 test: return ctx->epoch_time_in_ms;Executed by:
| 1 | ||||||
| 90 | } | - | ||||||
| Switch to Source code | Preprocessed file |