| Line | Source | Count |
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | | - |
| 5 | | - |
| 6 | | - |
| 7 | | - |
| 8 | | - |
| 9 | | - |
| 10 | #include <stdio.h> | - |
| 11 | #include <time.h> | - |
| 12 | #include <sys/types.h> | - |
| 13 | | - |
| 14 | #include "internal/cryptlib.h" | - |
| 15 | | - |
| 16 | #include <openssl/err.h> | - |
| 17 | #include <openssl/evp.h> | - |
| 18 | #include <openssl/buffer.h> | - |
| 19 | #include <openssl/x509.h> | - |
| 20 | | - |
| 21 | #ifndef NO_ASN1_OLD | - |
| 22 | | - |
| 23 | int ASN1_digest(i2d_of_void *i2d, const EVP_MD *type, char *data, | - |
| 24 | unsigned char *md, unsigned int *len) | - |
| 25 | { | - |
| 26 | int i; | - |
| 27 | unsigned char *str, *p; | - |
| 28 | | - |
| 29 | i = i2d(data, NULL); | - |
| 30 | if ((str = OPENSSL_malloc(i)) == NULL) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 31 | ASN1err(ASN1_F_ASN1_DIGEST, ERR_R_MALLOC_FAILURE); | - |
| 32 | return 0; never executed: return 0; | 0 |
| 33 | } | - |
| 34 | p = str; | - |
| 35 | i2d(data, &p); | - |
| 36 | | - |
| 37 | if (!EVP_Digest(str, i, md, len, type, NULL)) {| TRUE | never evaluated | | FALSE | never evaluated |
| 0 |
| 38 | OPENSSL_free(str); | - |
| 39 | return 0; never executed: return 0; | 0 |
| 40 | } | - |
| 41 | OPENSSL_free(str); | - |
| 42 | return 1; never executed: return 1; | 0 |
| 43 | } | - |
| 44 | | - |
| 45 | #endif | - |
| 46 | | - |
| 47 | int ASN1_item_digest(const ASN1_ITEM *it, const EVP_MD *type, void *asn, | - |
| 48 | unsigned char *md, unsigned int *len) | - |
| 49 | { | - |
| 50 | int i; | - |
| 51 | unsigned char *str = NULL; | - |
| 52 | | - |
| 53 | i = ASN1_item_i2d(asn, &str, it); | - |
| 54 | if (!str)| TRUE | never evaluated | | FALSE | evaluated 46877 times by 1 test |
| 0-46877 |
| 55 | return 0; never executed: return 0; | 0 |
| 56 | | - |
| 57 | if (!EVP_Digest(str, i, md, len, type, NULL)) {| TRUE | never evaluated | | FALSE | evaluated 46877 times by 1 test |
| 0-46877 |
| 58 | OPENSSL_free(str); | - |
| 59 | return 0; never executed: return 0; | 0 |
| 60 | } | - |
| 61 | OPENSSL_free(str); | - |
| 62 | return 1;executed 46877 times by 1 test: return 1; | 46877 |
| 63 | } | - |
| | |