| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/libressl/src/ssl/t1_hash.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | int | - | ||||||||||||
| 5 | tls1_handshake_hash_init(SSL *s) | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | const EVP_MD *md; | - | ||||||||||||
| 8 | long dlen; | - | ||||||||||||
| 9 | void *data; | - | ||||||||||||
| 10 | - | |||||||||||||
| 11 | tls1_handshake_hash_free(s); | - | ||||||||||||
| 12 | - | |||||||||||||
| 13 | if (!ssl_get_handshake_evp_md(s, &md)
| 0-128 | ||||||||||||
| 14 | ERR_put_error(20,(0xfff),((4|64)),__FILE__,32); | - | ||||||||||||
| 15 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 16 | } | - | ||||||||||||
| 17 | - | |||||||||||||
| 18 | if (((
| 0-128 | ||||||||||||
| 19 | ((void *)0)
| 0-128 | ||||||||||||
| 20 | ) { | - | ||||||||||||
| 21 | SSL_error_internal(s, (1|64), __FILE__, 37); | - | ||||||||||||
| 22 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 23 | } | - | ||||||||||||
| 24 | if (!EVP_DigestInit_ex((s->s3->internal)->handshake_hash, md,
| 0-128 | ||||||||||||
| 25 | ((void *)0)
| 0-128 | ||||||||||||
| 26 | )
| 0-128 | ||||||||||||
| 27 | SSL_error_internal(s, 6, __FILE__, 41); | - | ||||||||||||
| 28 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 29 | } | - | ||||||||||||
| 30 | - | |||||||||||||
| 31 | dlen = BIO_ctrl((s->s3->internal)->handshake_buffer,3,0,(char *)&data); | - | ||||||||||||
| 32 | if (dlen <= 0
| 0-128 | ||||||||||||
| 33 | SSL_error_internal(s, 332, __FILE__, 47); | - | ||||||||||||
| 34 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 35 | } | - | ||||||||||||
| 36 | if (!tls1_handshake_hash_update(s, data, dlen)
| 0-128 | ||||||||||||
| 37 | SSL_error_internal(s, 6, __FILE__, 51); | - | ||||||||||||
| 38 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 39 | } | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | return executed 128 times by 3 tests: 1;return 1;Executed by:
executed 128 times by 3 tests: return 1;Executed by:
| 128 | ||||||||||||
| 42 | - | |||||||||||||
| 43 | err: | - | ||||||||||||
| 44 | tls1_handshake_hash_free(s); | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||
| 47 | } | - | ||||||||||||
| 48 | - | |||||||||||||
| 49 | int | - | ||||||||||||
| 50 | tls1_handshake_hash_update(SSL *s, const unsigned char *buf, size_t len) | - | ||||||||||||
| 51 | { | - | ||||||||||||
| 52 | if ((
| 202-1078 | ||||||||||||
| 53 | ((void *)0)
| 202-1078 | ||||||||||||
| 54 | ) | - | ||||||||||||
| 55 | return executed 202 times by 4 tests: 1;return 1;Executed by:
executed 202 times by 4 tests: return 1;Executed by:
| 202 | ||||||||||||
| 56 | - | |||||||||||||
| 57 | return executed 1078 times by 3 tests: EVP_DigestUpdate((s->s3->internal)->handshake_hash, buf, len);return EVP_DigestUpdate((s->s3->internal)->handshake_hash, buf, len);Executed by:
executed 1078 times by 3 tests: return EVP_DigestUpdate((s->s3->internal)->handshake_hash, buf, len);Executed by:
| 1078 | ||||||||||||
| 58 | } | - | ||||||||||||
| 59 | - | |||||||||||||
| 60 | int | - | ||||||||||||
| 61 | tls1_handshake_hash_value(SSL *s, const unsigned char *out, size_t len, | - | ||||||||||||
| 62 | size_t *outlen) | - | ||||||||||||
| 63 | { | - | ||||||||||||
| 64 | EVP_MD_CTX *mdctx = | - | ||||||||||||
| 65 | ((void *)0) | - | ||||||||||||
| 66 | ; | - | ||||||||||||
| 67 | unsigned int mdlen; | - | ||||||||||||
| 68 | int ret = 0; | - | ||||||||||||
| 69 | - | |||||||||||||
| 70 | if (EVP_MD_size(EVP_MD_CTX_md((s->s3->internal)->handshake_hash)) > len
| 0-387 | ||||||||||||
| 71 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 72 | - | |||||||||||||
| 73 | if ((
| 0-387 | ||||||||||||
| 74 | ((void *)0)
| 0-387 | ||||||||||||
| 75 | ) { | - | ||||||||||||
| 76 | SSL_error_internal(s, (1|64), __FILE__, 84); | - | ||||||||||||
| 77 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 78 | } | - | ||||||||||||
| 79 | if (!EVP_MD_CTX_copy_ex(mdctx, (s->s3->internal)->handshake_hash)
| 0-387 | ||||||||||||
| 80 | SSL_error_internal(s, 6, __FILE__, 88); | - | ||||||||||||
| 81 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 82 | } | - | ||||||||||||
| 83 | if (!EVP_DigestFinal_ex(mdctx, (unsigned char *)out, &mdlen)
| 0-387 | ||||||||||||
| 84 | SSL_error_internal(s, 6, __FILE__, 92); | - | ||||||||||||
| 85 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||
| 86 | } | - | ||||||||||||
| 87 | if (outlen !=
| 31-356 | ||||||||||||
| 88 | ((void *)0)
| 31-356 | ||||||||||||
| 89 | ) | - | ||||||||||||
| 90 | * executed 356 times by 2 tests: outlen = mdlen;*outlen = mdlen;Executed by:
executed 356 times by 2 tests: *outlen = mdlen;Executed by:
| 356 | ||||||||||||
| 91 | - | |||||||||||||
| 92 | ret = 1; | - | ||||||||||||
| 93 | - | |||||||||||||
| 94 | err: code before this statement executed 387 times by 2 tests: err:Executed by:
| 387 | ||||||||||||
| 95 | EVP_MD_CTX_free(mdctx); | - | ||||||||||||
| 96 | - | |||||||||||||
| 97 | return executed 387 times by 2 tests: (ret);return (ret);Executed by:
executed 387 times by 2 tests: return (ret);Executed by:
| 387 | ||||||||||||
| 98 | } | - | ||||||||||||
| 99 | - | |||||||||||||
| 100 | void | - | ||||||||||||
| 101 | tls1_handshake_hash_free(SSL *s) | - | ||||||||||||
| 102 | { | - | ||||||||||||
| 103 | EVP_MD_CTX_free((s->s3->internal)->handshake_hash); | - | ||||||||||||
| 104 | (s->s3->internal)->handshake_hash = | - | ||||||||||||
| 105 | ((void *)0) | - | ||||||||||||
| 106 | ; | - | ||||||||||||
| 107 | } executed 1068 times by 11 tests: end of blockExecuted by:
| 1068 | ||||||||||||
| Switch to Source code | Preprocessed file |