| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/ssl/ssl_mcnf.c | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | - | |||||||
| 4 | void SSL_add_ssl_module(void) | - | ||||||
| 5 | { | - | ||||||
| 6 | - | |||||||
| 7 | } | - | ||||||
| 8 | - | |||||||
| 9 | static int ssl_do_config(SSL *s, SSL_CTX *ctx, const char *name, int system) | - | ||||||
| 10 | { | - | ||||||
| 11 | SSL_CONF_CTX *cctx = | - | ||||||
| 12 | ((void *)0) | - | ||||||
| 13 | ; | - | ||||||
| 14 | size_t i, idx, cmd_count; | - | ||||||
| 15 | int rv = 0; | - | ||||||
| 16 | unsigned int flags; | - | ||||||
| 17 | const SSL_METHOD *meth; | - | ||||||
| 18 | const SSL_CONF_CMD *cmds; | - | ||||||
| 19 | - | |||||||
| 20 |     if (s == 
  | 0-10470 | ||||||
| 21 |             ((void *)0)
  | 0-10470 | ||||||
| 22 |                  && ctx == 
  | 0-10470 | ||||||
| 23 |                            ((void *)0)
  | 0-10470 | ||||||
| 24 | ) { | - | ||||||
| 25 | ERR_put_error(20,(391),((3|64)),__FILE__,33); | - | ||||||
| 26 |         goto never executed:   err;goto err;never executed:  goto err; | 0 | ||||||
| 27 | } | - | ||||||
| 28 | - | |||||||
| 29 |     if (name == 
  | 2453-8017 | ||||||
| 30 |                ((void *)0)
  | 2453-8017 | ||||||
| 31 |                     && system
  | 0-8017 | ||||||
| 32 |         name = "system_default"; executed 8017 times by 2 tests:  name = "system_default";Executed by: 
  | 8017 | ||||||
| 33 |     if (!conf_ssl_name_find(name, &idx)
  | 2454-8016 | ||||||
| 34 |         if (!system
  | 0-8016 | ||||||
| 35 | ERR_put_error(20,(391),(113),__FILE__,41); | - | ||||||
| 36 | ERR_add_error_data(2, "name=", name); | - | ||||||
| 37 |         } never executed:  end of block | 0 | ||||||
| 38 |         goto executed 8016 times by 2 tests:   err;goto err;Executed by: 
 executed 8016 times by 2 tests:  goto err;Executed by: 
  | 8016 | ||||||
| 39 | } | - | ||||||
| 40 | cmds = conf_ssl_get(idx, &name, &cmd_count); | - | ||||||
| 41 | cctx = SSL_CONF_CTX_new(); | - | ||||||
| 42 |     if (cctx == 
  | 0-2454 | ||||||
| 43 |                ((void *)0)
  | 0-2454 | ||||||
| 44 | ) | - | ||||||
| 45 |         goto never executed:   err;goto err;never executed:  goto err; | 0 | ||||||
| 46 | flags = 0x2; | - | ||||||
| 47 |     if (!system
  | 1-2453 | ||||||
| 48 |         flags |= 0x20 | 0x40; executed 2453 times by 1 test:  flags |= 0x20 | 0x40;Executed by: 
  | 2453 | ||||||
| 49 |     if (s != 
  | 0-2454 | ||||||
| 50 |             ((void *)0)
  | 0-2454 | ||||||
| 51 | ) { | - | ||||||
| 52 | meth = s->method; | - | ||||||
| 53 | SSL_CONF_CTX_set_ssl(cctx, s); | - | ||||||
| 54 |     } never executed:   else {end of block | 0 | ||||||
| 55 | meth = ctx->method; | - | ||||||
| 56 | SSL_CONF_CTX_set_ssl_ctx(cctx, ctx); | - | ||||||
| 57 |     } executed 2454 times by 1 test:  end of blockExecuted by: 
  | 2454 | ||||||
| 58 |     if (meth->ssl_accept != ssl_undefined_function
  | 1210-1244 | ||||||
| 59 |         flags |= 0x8; executed 1244 times by 1 test:  flags |= 0x8;Executed by: 
  | 1244 | ||||||
| 60 |     if (meth->ssl_connect != ssl_undefined_function
  | 1211-1243 | ||||||
| 61 |         flags |= 0x4; executed 1211 times by 1 test:  flags |= 0x4;Executed by: 
  | 1211 | ||||||
| 62 | SSL_CONF_CTX_set_flags(cctx, flags); | - | ||||||
| 63 |     for (i = 0; i < cmd_count
  | 2454-10987 | ||||||
| 64 | char *cmdstr, *arg; | - | ||||||
| 65 | - | |||||||
| 66 | conf_ssl_get_cmd(cmds, i, &cmdstr, &arg); | - | ||||||
| 67 | rv = SSL_CONF_cmd(cctx, cmdstr, arg); | - | ||||||
| 68 |         if (rv <= 0
  | 0-10987 | ||||||
| 69 |             if (rv == -2
  | 0 | ||||||
| 70 |                 ERR_put_error(20,(391),(139),__FILE__,72); never executed:  ERR_put_error(20,(391),(139),__FILE__,72); | 0 | ||||||
| 71 | else | - | ||||||
| 72 |                 ERR_put_error(20,(391),(384),__FILE__,74); never executed:  ERR_put_error(20,(391),(384),__FILE__,74); | 0 | ||||||
| 73 | ERR_add_error_data(6, "section=", name, ", cmd=", cmdstr, | - | ||||||
| 74 | ", arg=", arg); | - | ||||||
| 75 |             goto never executed:   err;goto err;never executed:  goto err; | 0 | ||||||
| 76 | } | - | ||||||
| 77 |     } executed 10987 times by 1 test:  end of blockExecuted by: 
  | 10987 | ||||||
| 78 | rv = SSL_CONF_CTX_finish(cctx); | - | ||||||
| 79 |  err: code before this statement executed 2454 times by 1 test:  err:Executed by: 
  | 2454 | ||||||
| 80 | SSL_CONF_CTX_free(cctx); | - | ||||||
| 81 |     return executed 10470 times by 2 tests:   rv <= 0return rv <= 0 ? 0 : 1;Executed by: 
 
 executed 10470 times by 2 tests:  return rv <= 0 ? 0 : 1;Executed by: 
  | 2454-10470 | ||||||
| 82 | } | - | ||||||
| 83 | - | |||||||
| 84 | int SSL_config(SSL *s, const char *name) | - | ||||||
| 85 | { | - | ||||||
| 86 |     return never executed:   ssl_do_config(s, return ssl_do_config(s, ((void *)0) , name, 0);never executed:  return ssl_do_config(s, ((void *)0) , name, 0); | 0 | ||||||
| 87 |                            ((void *)0) never executed:  return ssl_do_config(s, ((void *)0) , name, 0); | 0 | ||||||
| 88 |                                , name, 0); never executed:  return ssl_do_config(s, ((void *)0) , name, 0); | 0 | ||||||
| 89 | } | - | ||||||
| 90 | - | |||||||
| 91 | int SSL_CTX_config(SSL_CTX *ctx, const char *name) | - | ||||||
| 92 | { | - | ||||||
| 93 |     return executed 2453 times by 1 test:   ssl_do_config(return ssl_do_config( ((void *)0) , ctx, name, 0);Executed by: 
 executed 2453 times by 1 test:  return ssl_do_config( ((void *)0) , ctx, name, 0);Executed by: 
  | 2453 | ||||||
| 94 |                         ((void *)0) executed 2453 times by 1 test:  return ssl_do_config( ((void *)0) , ctx, name, 0);Executed by: 
  | 2453 | ||||||
| 95 |                             , ctx, name, 0); executed 2453 times by 1 test:  return ssl_do_config( ((void *)0) , ctx, name, 0);Executed by: 
  | 2453 | ||||||
| 96 | } | - | ||||||
| 97 | - | |||||||
| 98 | void ssl_ctx_system_config(SSL_CTX *ctx) | - | ||||||
| 99 | { | - | ||||||
| 100 | ssl_do_config( | - | ||||||
| 101 | ((void *)0) | - | ||||||
| 102 | , ctx, | - | ||||||
| 103 | ((void *)0) | - | ||||||
| 104 | , 1); | - | ||||||
| 105 | } executed 8017 times by 2 tests:  end of blockExecuted by: 
  | 8017 | ||||||
| Switch to Source code | Preprocessed file |