| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/cmeth_lib.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||
|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||
| 2 | - | |||||||
| 3 | EVP_CIPHER *EVP_CIPHER_meth_new(int cipher_type, int block_size, int key_len) | - | ||||||
| 4 | { | - | ||||||
| 5 | EVP_CIPHER *cipher = CRYPTO_zalloc(sizeof(EVP_CIPHER), __FILE__, 18); | - | ||||||
| 6 | - | |||||||
| 7 | if (cipher !=
| 0-259 | ||||||
| 8 | ((void *)0)
| 0-259 | ||||||
| 9 | ) { | - | ||||||
| 10 | cipher->nid = cipher_type; | - | ||||||
| 11 | cipher->block_size = block_size; | - | ||||||
| 12 | cipher->key_len = key_len; | - | ||||||
| 13 | } executed 259 times by 1 test: end of blockExecuted by:
| 259 | ||||||
| 14 | return executed 259 times by 1 test: cipher;return cipher;Executed by:
executed 259 times by 1 test: return cipher;Executed by:
| 259 | ||||||
| 15 | } | - | ||||||
| 16 | - | |||||||
| 17 | EVP_CIPHER *EVP_CIPHER_meth_dup(const EVP_CIPHER *cipher) | - | ||||||
| 18 | { | - | ||||||
| 19 | EVP_CIPHER *to = EVP_CIPHER_meth_new(cipher->nid, cipher->block_size, | - | ||||||
| 20 | cipher->key_len); | - | ||||||
| 21 | - | |||||||
| 22 | if (to !=
| 0 | ||||||
| 23 | ((void *)0)
| 0 | ||||||
| 24 | ) | - | ||||||
| 25 | memcpy(to, cipher, sizeof(*to)); never executed: memcpy(to, cipher, sizeof(*to)); | 0 | ||||||
| 26 | return never executed: to;return to;never executed: return to; | 0 | ||||||
| 27 | } | - | ||||||
| 28 | - | |||||||
| 29 | void EVP_CIPHER_meth_free(EVP_CIPHER *cipher) | - | ||||||
| 30 | { | - | ||||||
| 31 | CRYPTO_free(cipher, __FILE__, 40); | - | ||||||
| 32 | } executed 737 times by 1 test: end of blockExecuted by:
| 737 | ||||||
| 33 | - | |||||||
| 34 | int EVP_CIPHER_meth_set_iv_length(EVP_CIPHER *cipher, int iv_len) | - | ||||||
| 35 | { | - | ||||||
| 36 | cipher->iv_len = iv_len; | - | ||||||
| 37 | return executed 259 times by 1 test: 1;return 1;Executed by:
executed 259 times by 1 test: return 1;Executed by:
| 259 | ||||||
| 38 | } | - | ||||||
| 39 | - | |||||||
| 40 | int EVP_CIPHER_meth_set_flags(EVP_CIPHER *cipher, unsigned long flags) | - | ||||||
| 41 | { | - | ||||||
| 42 | cipher->flags = flags; | - | ||||||
| 43 | return executed 259 times by 1 test: 1;return 1;Executed by:
executed 259 times by 1 test: return 1;Executed by:
| 259 | ||||||
| 44 | } | - | ||||||
| 45 | - | |||||||
| 46 | int EVP_CIPHER_meth_set_impl_ctx_size(EVP_CIPHER *cipher, int ctx_size) | - | ||||||
| 47 | { | - | ||||||
| 48 | cipher->ctx_size = ctx_size; | - | ||||||
| 49 | return executed 259 times by 1 test: 1;return 1;Executed by:
executed 259 times by 1 test: return 1;Executed by:
| 259 | ||||||
| 50 | } | - | ||||||
| 51 | - | |||||||
| 52 | int EVP_CIPHER_meth_set_init(EVP_CIPHER *cipher, | - | ||||||
| 53 | int (*init) (EVP_CIPHER_CTX *ctx, | - | ||||||
| 54 | const unsigned char *key, | - | ||||||
| 55 | const unsigned char *iv, | - | ||||||
| 56 | int enc)) | - | ||||||
| 57 | { | - | ||||||
| 58 | cipher->init = init; | - | ||||||
| 59 | return executed 259 times by 1 test: 1;return 1;Executed by:
executed 259 times by 1 test: return 1;Executed by:
| 259 | ||||||
| 60 | } | - | ||||||
| 61 | - | |||||||
| 62 | int EVP_CIPHER_meth_set_do_cipher(EVP_CIPHER *cipher, | - | ||||||
| 63 | int (*do_cipher) (EVP_CIPHER_CTX *ctx, | - | ||||||
| 64 | unsigned char *out, | - | ||||||
| 65 | const unsigned char *in, | - | ||||||
| 66 | size_t inl)) | - | ||||||
| 67 | { | - | ||||||
| 68 | cipher->do_cipher = do_cipher; | - | ||||||
| 69 | return executed 259 times by 1 test: 1;return 1;Executed by:
executed 259 times by 1 test: return 1;Executed by:
| 259 | ||||||
| 70 | } | - | ||||||
| 71 | - | |||||||
| 72 | int EVP_CIPHER_meth_set_cleanup(EVP_CIPHER *cipher, | - | ||||||
| 73 | int (*cleanup) (EVP_CIPHER_CTX *)) | - | ||||||
| 74 | { | - | ||||||
| 75 | cipher->cleanup = cleanup; | - | ||||||
| 76 | return executed 3 times by 1 test: 1;return 1;Executed by:
executed 3 times by 1 test: return 1;Executed by:
| 3 | ||||||
| 77 | } | - | ||||||
| 78 | - | |||||||
| 79 | int EVP_CIPHER_meth_set_set_asn1_params(EVP_CIPHER *cipher, | - | ||||||
| 80 | int (*set_asn1_parameters) (EVP_CIPHER_CTX *, | - | ||||||
| 81 | ASN1_TYPE *)) | - | ||||||
| 82 | { | - | ||||||
| 83 | cipher->set_asn1_parameters = set_asn1_parameters; | - | ||||||
| 84 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||
| 85 | } | - | ||||||
| 86 | - | |||||||
| 87 | int EVP_CIPHER_meth_set_get_asn1_params(EVP_CIPHER *cipher, | - | ||||||
| 88 | int (*get_asn1_parameters) (EVP_CIPHER_CTX *, | - | ||||||
| 89 | ASN1_TYPE *)) | - | ||||||
| 90 | { | - | ||||||
| 91 | cipher->get_asn1_parameters = get_asn1_parameters; | - | ||||||
| 92 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||
| 93 | } | - | ||||||
| 94 | - | |||||||
| 95 | int EVP_CIPHER_meth_set_ctrl(EVP_CIPHER *cipher, | - | ||||||
| 96 | int (*ctrl) (EVP_CIPHER_CTX *, int type, | - | ||||||
| 97 | int arg, void *ptr)) | - | ||||||
| 98 | { | - | ||||||
| 99 | cipher->ctrl = ctrl; | - | ||||||
| 100 | return executed 121 times by 1 test: 1;return 1;Executed by:
executed 121 times by 1 test: return 1;Executed by:
| 121 | ||||||
| 101 | } | - | ||||||
| 102 | - | |||||||
| 103 | - | |||||||
| 104 | int (*EVP_CIPHER_meth_get_init(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, | - | ||||||
| 105 | const unsigned char *key, | - | ||||||
| 106 | const unsigned char *iv, | - | ||||||
| 107 | int enc) | - | ||||||
| 108 | { | - | ||||||
| 109 | return executed 2089 times by 1 test: cipher->init;return cipher->init;Executed by:
executed 2089 times by 1 test: return cipher->init;Executed by:
| 2089 | ||||||
| 110 | } | - | ||||||
| 111 | int (*EVP_CIPHER_meth_get_do_cipher(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *ctx, | - | ||||||
| 112 | unsigned char *out, | - | ||||||
| 113 | const unsigned char *in, | - | ||||||
| 114 | size_t inl) | - | ||||||
| 115 | { | - | ||||||
| 116 | return executed 3361 times by 1 test: cipher->do_cipher;return cipher->do_cipher;Executed by:
executed 3361 times by 1 test: return cipher->do_cipher;Executed by:
| 3361 | ||||||
| 117 | } | - | ||||||
| 118 | - | |||||||
| 119 | int (*EVP_CIPHER_meth_get_cleanup(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *) | - | ||||||
| 120 | { | - | ||||||
| 121 | return never executed: cipher->cleanup;return cipher->cleanup;never executed: return cipher->cleanup; | 0 | ||||||
| 122 | } | - | ||||||
| 123 | - | |||||||
| 124 | int (*EVP_CIPHER_meth_get_set_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, | - | ||||||
| 125 | ASN1_TYPE *) | - | ||||||
| 126 | { | - | ||||||
| 127 | return never executed: cipher->set_asn1_parameters;return cipher->set_asn1_parameters;never executed: return cipher->set_asn1_parameters; | 0 | ||||||
| 128 | } | - | ||||||
| 129 | - | |||||||
| 130 | int (*EVP_CIPHER_meth_get_get_asn1_params(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, | - | ||||||
| 131 | ASN1_TYPE *) | - | ||||||
| 132 | { | - | ||||||
| 133 | return never executed: cipher->get_asn1_parameters;return cipher->get_asn1_parameters;never executed: return cipher->get_asn1_parameters; | 0 | ||||||
| 134 | } | - | ||||||
| 135 | - | |||||||
| 136 | int (*EVP_CIPHER_meth_get_ctrl(const EVP_CIPHER *cipher))(EVP_CIPHER_CTX *, | - | ||||||
| 137 | int type, int arg, | - | ||||||
| 138 | void *ptr) | - | ||||||
| 139 | { | - | ||||||
| 140 | return executed 1788 times by 1 test: cipher->ctrl;return cipher->ctrl;Executed by:
executed 1788 times by 1 test: return cipher->ctrl;Executed by:
| 1788 | ||||||
| 141 | } | - | ||||||
| Switch to Source code | Preprocessed file |