| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/openssl/src/crypto/store/store_locl.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /* | - |
| 2 | * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved. | - |
| 3 | * | - |
| 4 | * Licensed under the OpenSSL license (the "License"). You may not use | - |
| 5 | * this file except in compliance with the License. You can obtain a copy | - |
| 6 | * in the file LICENSE in the source distribution or at | - |
| 7 | * https://www.openssl.org/source/license.html | - |
| 8 | */ | - |
| 9 | - | |
| 10 | #include "internal/thread_once.h" | - |
| 11 | #include <openssl/dsa.h> | - |
| 12 | #include <openssl/engine.h> | - |
| 13 | #include <openssl/evp.h> | - |
| 14 | #include <openssl/lhash.h> | - |
| 15 | #include <openssl/x509.h> | - |
| 16 | #include <openssl/store.h> | - |
| 17 | - | |
| 18 | /*- | - |
| 19 | * OSSL_STORE_INFO stuff | - |
| 20 | * --------------------- | - |
| 21 | */ | - |
| 22 | - | |
| 23 | struct ossl_store_info_st { | - |
| 24 | int type; | - |
| 25 | union { | - |
| 26 | void *data; /* used internally as generic pointer */ | - |
| 27 | - | |
| 28 | struct { | - |
| 29 | BUF_MEM *blob; | - |
| 30 | char *pem_name; | - |
| 31 | } embedded; /* when type == OSSL_STORE_INFO_EMBEDDED */ | - |
| 32 | - | |
| 33 | struct { | - |
| 34 | char *name; | - |
| 35 | char *desc; | - |
| 36 | } name; /* when type == OSSL_STORE_INFO_NAME */ | - |
| 37 | - | |
| 38 | EVP_PKEY *params; /* when type == OSSL_STORE_INFO_PARAMS */ | - |
| 39 | EVP_PKEY *pkey; /* when type == OSSL_STORE_INFO_PKEY */ | - |
| 40 | X509 *x509; /* when type == OSSL_STORE_INFO_CERT */ | - |
| 41 | X509_CRL *crl; /* when type == OSSL_STORE_INFO_CRL */ | - |
| 42 | } _; | - |
| 43 | }; | - |
| 44 | - | |
| 45 | DEFINE_STACK_OF(OSSL_STORE_INFO) never executed: end of blocknever executed: end of blocknever executed: end of blocknever executed: end of blocknever executed: return OPENSSL_sk_num((const OPENSSL_STACK *)sk);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_value((const OPENSSL_STACK *)sk, idx);never executed: return (struct stack_st_OSSL_STORE_INFO *)OPENSSL_sk_new((OPENSSL_sk_compfunc)compare);never executed: return (struct stack_st_OSSL_STORE_INFO *)OPENSSL_sk_new_null();never executed: return (struct stack_st_OSSL_STORE_INFO *)OPENSSL_sk_new_reserve((OPENSSL_sk_compfunc)compare, n);never executed: return OPENSSL_sk_reserve((OPENSSL_STACK *)sk, n);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_delete((OPENSSL_STACK *)sk, i);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_delete_ptr((OPENSSL_STACK *)sk, (const void *)ptr);never executed: return OPENSSL_sk_push((OPENSSL_STACK *)sk, (const void *)ptr);never executed: return OPENSSL_sk_unshift((OPENSSL_STACK *)sk, (const void *)ptr);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_pop((OPENSSL_STACK *)sk);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_shift((OPENSSL_STACK *)sk);never executed: return OPENSSL_sk_insert((OPENSSL_STACK *)sk, (const void *)ptr, idx);never executed: return (OSSL_STORE_INFO *)OPENSSL_sk_set((OPENSSL_STACK *)sk, idx, (const void *)ptr);never executed: return OPENSSL_sk_find((OPENSSL_STACK *)sk, (const void *)ptr);never executed: return OPENSSL_sk_find_ex((OPENSSL_STACK *)sk, (const void *)ptr);never executed: return OPENSSL_sk_is_sorted((const OPENSSL_STACK *)sk);never executed: return (struct stack_st_OSSL_STORE_INFO *)OPENSSL_sk_dup((const OPENSSL_STACK *)sk);never executed: return (struct stack_st_OSSL_STORE_INFO *)OPENSSL_sk_deep_copy((const OPENSSL_STACK *)sk, (OPENSSL_sk_copyfunc)copyfunc, (OPENSSL_sk_freefunc)freefunc);never executed: return (sk_OSSL_STORE_INFO_compfunc)OPENSSL_sk_set_cmp_func((OPENSSL_STACK *)sk, (OPENSSL_sk_compfunc)compare); | 0 |
| 46 | - | |
| 47 | /* | - |
| 48 | * EMBEDDED is a special type of OSSL_STORE_INFO, specially for the file | - |
| 49 | * handlers. It should never reach a calling application or any engine. | - |
| 50 | * However, it can be used by a FILE_HANDLER's try_decode function to signal | - |
| 51 | * that it has decoded the incoming blob into a new blob, and that the | - |
| 52 | * attempted decoding should be immediately restarted with the new blob, using | - |
| 53 | * the new PEM name. | - |
| 54 | */ | - |
| 55 | /* | - |
| 56 | * Because this is an internal type, we don't make it public. | - |
| 57 | */ | - |
| 58 | #define OSSL_STORE_INFO_EMBEDDED -1 | - |
| 59 | OSSL_STORE_INFO *ossl_store_info_new_EMBEDDED(const char *new_pem_name, | - |
| 60 | BUF_MEM *embedded); | - |
| 61 | BUF_MEM *ossl_store_info_get0_EMBEDDED_buffer(OSSL_STORE_INFO *info); | - |
| 62 | char *ossl_store_info_get0_EMBEDDED_pem_name(OSSL_STORE_INFO *info); | - |
| 63 | - | |
| 64 | /*- | - |
| 65 | * OSSL_STORE_SEARCH stuff | - |
| 66 | * ----------------------- | - |
| 67 | */ | - |
| 68 | - | |
| 69 | struct ossl_store_search_st { | - |
| 70 | int search_type; | - |
| 71 | - | |
| 72 | /* | - |
| 73 | * Used by OSSL_STORE_SEARCH_BY_NAME and | - |
| 74 | * OSSL_STORE_SEARCH_BY_ISSUER_SERIAL | - |
| 75 | */ | - |
| 76 | X509_NAME *name; | - |
| 77 | - | |
| 78 | /* Used by OSSL_STORE_SEARCH_BY_ISSUER_SERIAL */ | - |
| 79 | const ASN1_INTEGER *serial; | - |
| 80 | - | |
| 81 | /* Used by OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT */ | - |
| 82 | const EVP_MD *digest; | - |
| 83 | - | |
| 84 | /* | - |
| 85 | * Used by OSSL_STORE_SEARCH_BY_KEY_FINGERPRINT and | - |
| 86 | * OSSL_STORE_SEARCH_BY_ALIAS | - |
| 87 | */ | - |
| 88 | const unsigned char *string; | - |
| 89 | size_t stringlength; | - |
| 90 | }; | - |
| 91 | - | |
| 92 | /*- | - |
| 93 | * OSSL_STORE_LOADER stuff | - |
| 94 | * ----------------------- | - |
| 95 | */ | - |
| 96 | - | |
| 97 | int ossl_store_register_loader_int(OSSL_STORE_LOADER *loader); | - |
| 98 | OSSL_STORE_LOADER *ossl_store_unregister_loader_int(const char *scheme); | - |
| 99 | - | |
| 100 | /* loader stuff */ | - |
| 101 | struct ossl_store_loader_st { | - |
| 102 | const char *scheme; | - |
| 103 | ENGINE *engine; | - |
| 104 | OSSL_STORE_open_fn open; | - |
| 105 | OSSL_STORE_ctrl_fn ctrl; | - |
| 106 | OSSL_STORE_expect_fn expect; | - |
| 107 | OSSL_STORE_find_fn find; | - |
| 108 | OSSL_STORE_load_fn load; | - |
| 109 | OSSL_STORE_eof_fn eof; | - |
| 110 | OSSL_STORE_error_fn error; | - |
| 111 | OSSL_STORE_close_fn close; | - |
| 112 | }; | - |
| 113 | DEFINE_LHASH_OF(OSSL_STORE_LOADER); executed 2076 times by 12 tests: end of blockExecuted by:
never executed: end of blocknever executed: end of blocknever executed: end of blocknever executed: end of blocknever executed: end of blocknever executed: return (struct lhash_st_OSSL_STORE_LOADER *) OPENSSL_LH_new((OPENSSL_LH_HASHFUNC)hfn, (OPENSSL_LH_COMPFUNC)cfn);never executed: return (OSSL_STORE_LOADER *)OPENSSL_LH_insert((OPENSSL_LHASH *)lh, d);never executed: return (OSSL_STORE_LOADER *)OPENSSL_LH_delete((OPENSSL_LHASH *)lh, d);never executed: return (OSSL_STORE_LOADER *)OPENSSL_LH_retrieve((OPENSSL_LHASH *)lh, d);never executed: return OPENSSL_LH_error((OPENSSL_LHASH *)lh);never executed: return OPENSSL_LH_num_items((OPENSSL_LHASH *)lh);never executed: return OPENSSL_LH_get_down_load((OPENSSL_LHASH *)lh); | 0-2076 |
| 114 | - | |
| 115 | const OSSL_STORE_LOADER *ossl_store_get0_loader_int(const char *scheme); | - |
| 116 | void ossl_store_destroy_loaders_int(void); | - |
| 117 | - | |
| 118 | /*- | - |
| 119 | * OSSL_STORE init stuff | - |
| 120 | * --------------------- | - |
| 121 | */ | - |
| 122 | - | |
| 123 | int ossl_store_init_once(void); | - |
| 124 | int ossl_store_file_loader_init(void); | - |
| 125 | - | |
| 126 | /*- | - |
| 127 | * 'file' scheme stuff | - |
| 128 | * ------------------- | - |
| 129 | */ | - |
| 130 | - | |
| 131 | OSSL_STORE_LOADER_CTX *ossl_store_file_attach_pem_bio_int(BIO *bp); | - |
| 132 | int ossl_store_file_detach_pem_bio_int(OSSL_STORE_LOADER_CTX *ctx); | - |
| Source code | Switch to Preprocessed file |