| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/evp/p_seal.c |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | int EVP_SealInit(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, | - | ||||||||||||||||||
| 4 | unsigned char **ek, int *ekl, unsigned char *iv, | - | ||||||||||||||||||
| 5 | EVP_PKEY **pubk, int npubk) | - | ||||||||||||||||||
| 6 | { | - | ||||||||||||||||||
| 7 | unsigned char key[64]; | - | ||||||||||||||||||
| 8 | int i; | - | ||||||||||||||||||
| 9 | int rv = 0; | - | ||||||||||||||||||
| 10 | - | |||||||||||||||||||
| 11 | if (type
| 0-1 | ||||||||||||||||||
| 12 | EVP_CIPHER_CTX_reset(ctx); | - | ||||||||||||||||||
| 13 | if (!EVP_EncryptInit_ex(ctx, type,
| 0-1 | ||||||||||||||||||
| 14 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 15 | ,
| 0-1 | ||||||||||||||||||
| 16 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 17 | ,
| 0-1 | ||||||||||||||||||
| 18 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 19 | )
| 0-1 | ||||||||||||||||||
| 20 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 21 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 22 | if ((
| 0-1 | ||||||||||||||||||
| 23 | return never executed: 1;return 1;never executed: return 1; | 0 | ||||||||||||||||||
| 24 | if (EVP_CIPHER_CTX_rand_key(ctx, key) <= 0
| 0-1 | ||||||||||||||||||
| 25 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 26 | - | |||||||||||||||||||
| 27 | if (EVP_CIPHER_CTX_iv_length(ctx)
| 0-1 | ||||||||||||||||||
| 28 | && RAND_bytes(iv, EVP_CIPHER_CTX_iv_length(ctx)) <= 0
| 0-1 | ||||||||||||||||||
| 29 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 30 | - | |||||||||||||||||||
| 31 | if (!EVP_EncryptInit_ex(ctx,
| 0-1 | ||||||||||||||||||
| 32 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 33 | ,
| 0-1 | ||||||||||||||||||
| 34 | ((void *)0)
| 0-1 | ||||||||||||||||||
| 35 | , key, iv)
| 0-1 | ||||||||||||||||||
| 36 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 37 | - | |||||||||||||||||||
| 38 | for (i = 0; i < npubk
| 1 | ||||||||||||||||||
| 39 | ekl[i] = | - | ||||||||||||||||||
| 40 | EVP_PKEY_encrypt_old(ek[i], key, EVP_CIPHER_CTX_key_length(ctx), | - | ||||||||||||||||||
| 41 | pubk[i]); | - | ||||||||||||||||||
| 42 | if (ekl[i] <= 0
| 0-1 | ||||||||||||||||||
| 43 | rv = -1; | - | ||||||||||||||||||
| 44 | goto never executed: err;goto err;never executed: goto err; | 0 | ||||||||||||||||||
| 45 | } | - | ||||||||||||||||||
| 46 | } executed 1 time by 1 test: end of blockExecuted by:
| 1 | ||||||||||||||||||
| 47 | rv = npubk; | - | ||||||||||||||||||
| 48 | err: code before this statement executed 1 time by 1 test: err:Executed by:
| 1 | ||||||||||||||||||
| 49 | OPENSSL_cleanse(key, sizeof(key)); | - | ||||||||||||||||||
| 50 | return executed 1 time by 1 test: rv;return rv;Executed by:
executed 1 time by 1 test: return rv;Executed by:
| 1 | ||||||||||||||||||
| 51 | } | - | ||||||||||||||||||
| 52 | - | |||||||||||||||||||
| 53 | int EVP_SealFinal(EVP_CIPHER_CTX *ctx, unsigned char *out, int *outl) | - | ||||||||||||||||||
| 54 | { | - | ||||||||||||||||||
| 55 | int i; | - | ||||||||||||||||||
| 56 | i = EVP_EncryptFinal_ex(ctx, out, outl); | - | ||||||||||||||||||
| 57 | if (i
| 0-1 | ||||||||||||||||||
| 58 | i = EVP_EncryptInit_ex(ctx, executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 59 | ((void *)0) executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 60 | , executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 61 | ((void *)0) executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 62 | , executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 63 | ((void *)0) executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 64 | , executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 65 | ((void *)0) executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 66 | ); executed 1 time by 1 test: i = EVP_EncryptInit_ex(ctx, ((void *)0) , ((void *)0) , ((void *)0) , ((void *)0) );Executed by:
| 1 | ||||||||||||||||||
| 67 | return executed 1 time by 1 test: i;return i;Executed by:
executed 1 time by 1 test: return i;Executed by:
| 1 | ||||||||||||||||||
| 68 | } | - | ||||||||||||||||||
| Switch to Source code | Preprocessed file |