func
stringlengths
0
484k
target
int64
0
1
cwe
list
project
stringlengths
2
29
commit_id
stringlengths
40
40
hash
float64
1,215,700,430,453,689,100,000,000B
340,281,914,521,452,260,000,000,000,000B
size
int64
1
24k
message
stringlengths
0
13.3k
static enum auth_userdb_skip auth_userdb_skip_parse(const char *str) { if (strcmp(str, "never") == 0) return AUTH_USERDB_SKIP_NEVER; if (strcmp(str, "found") == 0) return AUTH_USERDB_SKIP_FOUND; if (strcmp(str, "notfound") == 0) return AUTH_USERDB_SKIP_NOTFOUND; i_unreached(); }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
304,434,282,410,914,740,000,000,000,000,000,000,000
10
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void passdb_init(struct passdb_module *passdb) { if (passdb->iface.init != NULL && passdb->init_refcount == 0) passdb->iface.init(passdb); passdb->init_refcount++; }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
259,069,160,174,440,640,000,000,000,000,000,000,000
6
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
const char *auth_request_get_log_prefix_db(struct auth_request *auth_request) { string_t *str = t_str_new(64); auth_request_get_log_prefix(str, auth_request, AUTH_SUBSYS_DB); return str_c(str); }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
107,981,855,448,049,030,000,000,000,000,000,000,000
6
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_validate_networks(struct auth_request *request, const char *name, const char *networks, const struct ip_addr *remote_ip) { const char *const *net; struct ip_addr net_ip; unsigned int bits; bool found = FALSE; for (net = t_strsplit_spaces(networks, ", "); *net != NULL; net++) { e_debug(authd...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
215,220,411,848,651,380,000,000,000,000,000,000,000
41
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static void auth_request_set_uidgid_file(struct auth_request *request, const char *path_template) { string_t *path; struct stat st; const char *error; path = t_str_new(256); if (auth_request_var_expand(path, path_template, request, NULL, &error) <= 0) { e_error(authdb_event(request), "Failed to...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
208,115,955,977,731,700,000,000,000,000,000,000,000
24
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_verify_plain_callback_finish(enum passdb_result result, struct auth_request *request) { const char *error; if (passdb_template_export(request->passdb->override_fields_tmpl, request, &error) < 0) { e_error(authdb_event(request), "Failed to expand override_fields: %s", error); result ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
109,245,544,769,315,000,000,000,000,000,000,000,000
22
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
struct auth *auth_default_service(void) { struct auth *const *a; unsigned int count; a = array_get(&auths, &count); return a[0]; }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
322,834,103,662,898,970,000,000,000,000,000,000,000
8
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_want_skip_passdb(struct auth_request *request, struct auth_passdb *passdb) { /* if mechanism is not supported, skip */ const char *const *mechs = passdb->mechanisms; const char *const *username_filter = passdb->username_filter; const char *username; username = request->fields.user; if (!au...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
295,394,450,798,309,080,000,000,000,000,000,000,000
41
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
bool passdb_get_credentials(struct auth_request *auth_request, const char *input, const char *input_scheme, const unsigned char **credentials_r, size_t *size_r) { const char *wanted_scheme = auth_request->wanted_credentials_scheme; const char *plaintext, *error; int ret; struct password_generate_param...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
42,487,415,910,187,493,000,000,000,000,000,000,000
77
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_preinit(const struct auth_settings *set, const char *service, pool_t pool, const struct mechanisms_register *reg) { struct auth_passdb_settings *const *passdbs; struct auth_userdb_settings *const *userdbs; struct auth *auth; unsigned int i, count, db_count, passdb_count, last_passdb = 0; auth = p_new(p...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
185,529,213,493,235,600,000,000,000,000,000,000,000
70
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_lookup_credentials_finish(enum passdb_result result, const unsigned char *credentials, size_t size, struct auth_request *request) { const char *error; if (passdb_template_export(request->passdb->override_fields_tmpl, request, &error) < 0) { e_error(authdb_event(request), "Fail...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
96,052,801,074,434,990,000,000,000,000,000,000,000
51
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static void get_log_identifier(string_t *str, struct auth_request *auth_request) { const char *ip; if (auth_request->fields.user == NULL) str_append(str, "?"); else str_sanitize_append(str, auth_request->fields.user, MAX_LOG_USERNAME_LEN); ip = net_ip2addr(&auth_request->fields.remote_ip); if ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
58,722,511,702,666,360,000,000,000,000,000,000,000
20
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void passdb_handle_credentials(enum passdb_result result, const char *password, const char *scheme, lookup_credentials_callback_t *callback, struct auth_request *auth_request) { const unsigned char *credentials = NULL; size_t size = 0; if (result != PASSDB_RESULT_O...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
251,550,736,653,276,150,000,000,000,000,000,000,000
37
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_get_log_prefix(string_t *str, struct auth_request *auth_request, const char *subsystem) { const char *name; if (subsystem == AUTH_SUBSYS_DB) { if (!auth_request->userdb_lookup) { i_assert(auth_request->passdb != NULL); name = auth_request->passdb->set->name[0] != '\0' ? auth_reques...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
210,366,735,746,356,220,000,000,000,000,000,000,000
28
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_finished_event(struct auth_request *request, struct event *event) { struct event_passthrough *e = event_create_passthrough(event); if (request->failed) { if (request->internal_failure) { e->add_str("error", "internal failure"); } else { e->add_str("error", "authentication failed"); } } else...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
224,124,257,491,980,050,000,000,000,000,000,000,000
28
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static void auth_request_userdb_save_cache(struct auth_request *request, enum userdb_result result) { struct auth_userdb *userdb = request->userdb; string_t *str; const char *cache_value; if (passdb_cache == NULL || userdb->cache_key == NULL) return; if (result == USERDB_RESULT_USER_UNKNOWN) cache_va...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
31,775,664,497,916,970,000,000,000,000,000,000,000
35
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static const char *get_log_prefix_mech(struct auth_request *auth_request) { string_t *str = t_str_new(64); auth_request_get_log_prefix(str, auth_request, AUTH_SUBSYS_MECH); return str_c(str); }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
43,760,305,651,970,240,000,000,000,000,000,000,000
6
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void passdbs_deinit(void) { array_free(&passdb_modules); array_free(&passdb_interfaces); }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
92,699,241,085,908,360,000,000,000,000,000,000,000
5
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
passdb_find(const char *driver, const char *args, unsigned int *idx_r) { struct passdb_module *const *passdbs; unsigned int i, count; passdbs = array_get(&passdb_modules, &count); for (i = 0; i < count; i++) { if (strcmp(passdbs[i]->iface.name, driver) == 0 && strcmp(passdbs[i]->args, args) == 0) { *idx...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
241,381,298,484,756,800,000,000,000,000,000,000,000
15
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_init(struct auth_request *request) { struct auth *auth; auth = auth_request_get_auth(request); request->set = auth->set; request->passdb = auth->passdbs; request->userdb = auth->userdbs; }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
283,459,104,215,308,800,000,000,000,000,000,000,000
9
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static void auth_request_save_cache(struct auth_request *request, enum passdb_result result) { struct auth_passdb *passdb = request->passdb; const char *encoded_password; string_t *str; struct password_generate_params gen_params = { .user = request->fields.user, .rounds = 0 }; switch (result) { case...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
35,189,958,359,931,746,000,000,000,000,000,000,000
85
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_proxy_finish_failure(struct auth_request *request) { /* drop all proxying fields */ auth_fields_remove(request->fields.extra_fields, "proxy"); auth_fields_remove(request->fields.extra_fields, "proxy_maybe"); auth_fields_remove(request->fields.extra_fields, "proxy_always"); auth_fields_remove(requ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
103,395,206,713,376,130,000,000,000,000,000,000,000
10
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_userdb_lookup_begin(struct auth_request *request) { struct event *event; const char *name; i_assert(request->userdb != NULL); i_assert(request->userdb_lookup); request->userdb_cache_result = AUTH_REQUEST_CACHE_NONE; name = (request->userdb->set->name[0] != '\0' ? request->userdb->set->name ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
278,584,415,886,899,500,000,000,000,000,000,000,000
33
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static bool password_has_illegal_chars(const char *password) { for (; *password != '\0'; password++) { switch (*password) { case '\001': case '\t': case '\r': case '\n': /* these characters have a special meaning in internal protocols, make sure the password doesn't accidentally get there unes...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
16,750,744,685,248,195,000,000,000,000,000,000,000
16
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_set_null_field(struct auth_request *request, const char *name) { if (str_begins_with(name, "userdb_")) { /* make sure userdb prefetch is used even if all the fields were returned as NULL. */ request->userdb_prefetch_set = TRUE; } }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
175,437,431,699,457,440,000,000,000,000,000,000,000
8
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static bool auth_passdb_list_have_verify_plain(const struct auth *auth) { const struct auth_passdb *passdb; for (passdb = auth->passdbs; passdb != NULL; passdb = passdb->next) { if (passdb->passdb->iface.verify_plain != NULL) return TRUE; } return FALSE; }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
115,288,490,576,595,590,000,000,000,000,000,000,000
10
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_set_password(struct auth_request *request, const char *value, const char *default_scheme, bool noscheme) { if (request->passdb_password != NULL) { e_error(authdb_event(request), "Multiple password values not supported"); return; } /* if the password starts with '{' it most likely contains ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
296,004,270,249,825,600,000,000,000,000,000,000,000
22
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_set_userdb_field(struct auth_request *request, const char *name, const char *value) { size_t name_len = strlen(name); uid_t uid; gid_t gid; i_assert(value != NULL); if (name_len > 10 && strcmp(name+name_len-10, ":protected") == 0) { /* set this field only if it hasn't been set before *...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
222,936,161,496,951,630,000,000,000,000,000,000,000
61
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void passdbs_generate_md5(unsigned char md5[STATIC_ARRAY MD5_RESULTLEN]) { struct md5_context ctx; struct passdb_module *const *passdbs; unsigned int i, count; md5_init(&ctx); passdbs = array_get(&passdb_modules, &count); for (i = 0; i < count; i++) { md5_update(&ctx, &passdbs[i]->id, sizeof(passdbs[i]->id)); ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
307,122,355,094,122,370,000,000,000,000,000,000,000
16
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_cache_result_to_str(enum auth_request_cache_result result) { switch(result) { case AUTH_REQUEST_CACHE_NONE: return "none"; case AUTH_REQUEST_CACHE_HIT: return "hit"; case AUTH_REQUEST_CACHE_MISS: return "miss"; default: i_unreached(); } }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
298,297,055,143,176,520,000,000,000,000,000,000,000
13
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_mechanism_accepted(const char *const *mechs, const struct mech_module *mech) { /* no filter specified, anything goes */ if (mechs == NULL) return TRUE; /* request has no mechanism, see if none is accepted */ if (mech == NULL) return str_array_icase_find(mechs, "none"); /* check if request mechan...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
329,532,874,144,167,880,000,000,000,000,000,000,000
11
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_request_userdb_import(struct auth_request *request, const char *args) { const char *key, *value, *const *arg; for (arg = t_strsplit(args, "\t"); *arg != NULL; arg++) { value = strchr(*arg, '='); if (value == NULL) { key = *arg; value = ""; } else { key = t_strdup_until(*arg, value); value++; ...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
295,774,120,224,415,970,000,000,000,000,000,000,000
16
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_policy_check_callback(int result, void *context) { struct auth_policy_check_ctx *ctx = context; ctx->request->policy_processed = TRUE; /* It's possible that multiple policy lookups return a penalty. Sum them all up to the event. */ ctx->request->policy_penalty += result < 0 ? 0 : result; if...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
41,315,941,665,400,853,000,000,000,000,000,000
25
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_passdb_lookup_begin(struct auth_request *request) { struct event *event; const char *name; i_assert(request->passdb != NULL); i_assert(!request->userdb_lookup); request->passdb_cache_result = AUTH_REQUEST_CACHE_NONE; name = (request->passdb->set->name[0] != '\0' ? request->passdb->set->name...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
38,704,613,206,989,160,000,000,000,000,000,000,000
33
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auths_deinit(void) { struct auth *auth; array_foreach_elem(&auths, auth) auth_deinit(auth); event_unref(&auth_event); }
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
101,530,717,138,168,940,000,000,000,000,000,000,000
8
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
bool auth_request_import_master(struct auth_request *request, const char *key, const char *value) { pid_t pid; i_assert(value != NULL); /* master request lookups may set these */ if (strcmp(key, "session_pid") == 0) { if (str_to_pid(value, &pid) == 0) request->session_pid = pid; } else if (strcmp(key, "...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
55,263,339,253,085,470,000,000,000,000,000,000,000
17
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
auth_passdb_preinit(struct auth *auth, const struct auth_passdb_settings *set, struct auth_passdb **passdbs) { struct auth_passdb *auth_passdb, **dest; auth_passdb = p_new(auth->pool, struct auth_passdb, 1); auth_passdb->set = set; auth_passdb->skip = auth_passdb_skip_parse(set->skip); auth_passdb->result_s...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
204,674,407,859,340,960,000,000,000,000,000,000,000
56
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
int auth_request_proxy_finish(struct auth_request *request, auth_request_proxy_cb_t *callback) { const char *host, *hostip; struct ip_addr ip; bool proxy_host_is_self; if (request->auth_only) return 1; if (!auth_fields_exists(request->fields.extra_fields, "proxy") && !auth_fields_exists(request->f...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
71,481,426,414,463,730,000,000,000,000,000,000,000
47
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
void auth_request_lookup_credentials_callback(enum passdb_result result, const unsigned char *credentials, size_t size, struct auth_request *request) { struct auth_passdb *passdb = request->passdb; const char *cache_cred, *cache_scheme; i_assert(request->state == AUTH_REQUEST_STATE_...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
68,778,250,921,784,150,000,000,000,000,000,000,000
40
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
static void auth_mech_list_verify_passdb(const struct auth *auth) { const struct mech_module_list *list; for (list = auth->reg->modules; list != NULL; list = list->next) { if (!auth_mech_verify_passdb(auth, list)) break; } if (list != NULL) { if (auth->passdbs == NULL) { i_fatal("No passdbs specified in...
0
[ "CWE-284" ]
core
7bad6a24160e34bce8f10e73dbbf9e5fbbcd1904
322,053,230,118,603,120,000,000,000,000,000,000,000
19
auth: Fix handling passdbs with identical driver/args but different mechanisms/username_filter The passdb was wrongly deduplicated in this situation, causing wrong mechanisms or username_filter setting to be used. This would be a rather unlikely configuration though. Fixed by moving mechanisms and username_filter fro...
int CMS_data(CMS_ContentInfo *cms, BIO *out, unsigned int flags) { BIO *cont; int r; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_data) { CMSerr(CMS_F_CMS_DATA, CMS_R_TYPE_NOT_DATA); return 0; } cont = CMS_dataInit(cms, NULL); if (!cont) return 0; r = cms_copy_content(out, cont, flags); BIO_free_a...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
53,422,576,366,253,290,000,000,000,000,000,000,000
16
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_digest_create(BIO *in, const EVP_MD *md, unsigned int flags) { CMS_ContentInfo *cms; if (!md) md = EVP_sha1(); cms = cms_DigestedData_create(md); if (!cms) return NULL; if(!(flags & CMS_DETACHED)) CMS_set_detached(cms, 0); if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, fla...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
298,241,976,962,536,230,000,000,000,000,000,000,000
19
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static BIO *cms_get_text_bio(BIO *out, unsigned int flags) { BIO *rbio; if (out == NULL) rbio = BIO_new(BIO_s_null()); else if (flags & CMS_TEXT) { rbio = BIO_new(BIO_s_mem()); BIO_set_mem_eof_return(rbio, 0); } else rbio = out; return rbio; }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
215,048,021,619,311,820,000,000,000,000,000,000,000
14
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_EncryptedData_encrypt(BIO *in, const EVP_CIPHER *cipher, const unsigned char *key, size_t keylen, unsigned int flags) { CMS_ContentInfo *cms; if (!cipher) { CMSerr(CMS_F_CMS_ENCRYPTEDDATA_ENCRYPT, CMS_R_NO_CIPHER); return NULL; } cms = CMS_ContentInfo_new(); if (!cms) retur...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
94,615,474,666,619,200,000,000,000,000,000,000,000
26
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_decrypt_set1_password(CMS_ContentInfo *cms, unsigned char *pass, ossl_ssize_t passlen) { STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; int i, r; ris = CMS_get0_RecipientInfos(cms); for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++) { ri = sk_CMS_RecipientInfo_value(ris, i); if (CMS_...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
311,979,794,371,160,270,000,000,000,000,000,000,000
23
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_data_create(BIO *in, unsigned int flags) { CMS_ContentInfo *cms; cms = cms_Data_create(); if (!cms) return NULL; if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) return cms; CMS_ContentInfo_free(cms); return NULL; }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
101,794,057,873,158,460,000,000,000,000,000,000,000
14
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) { BIO *cont; int r; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_id_smime_ct_compressedData) { CMSerr(CMS_F_CMS_UNCOMPRESS, CMS_R_TYPE_NOT_COMPRESSED_DATA); return 0; } if (!dcont && !check_content(cms)) return ...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
6,756,812,096,794,177,000,000,000,000,000,000,000
22
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static int check_content(CMS_ContentInfo *cms) { ASN1_OCTET_STRING **pos = CMS_get0_content(cms); if (!pos || !*pos) { CMSerr(CMS_F_CHECK_CONTENT, CMS_R_NO_CONTENT); return 0; } return 1; }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
69,198,527,796,664,520,000,000,000,000,000,000,000
10
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_decrypt_set1_pkey(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert) { STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; int i, r, ri_type; int debug = 0; ris = CMS_get0_RecipientInfos(cms); if (ris) debug = cms->d.envelopedData->encryptedContentInfo->debug; ri_type = cms_pkey_get_ri_type(pk); if...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
134,121,144,978,480,980,000,000,000,000,000,000,000
75
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_decrypt(CMS_ContentInfo *cms, EVP_PKEY *pk, X509 *cert, BIO *dcont, BIO *out, unsigned int flags) { int r; BIO *cont; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_enveloped) { CMSerr(CMS_F_CMS_DECRYPT, CMS_R_TYPE_NOT_ENVELOPED_DATA); return 0; } if (!dcont && !check_content(cms)) retu...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
156,983,043,614,779,650,000,000,000,000,000,000,000
28
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags) { CMS_ContentInfo *cms; if (comp_nid <= 0) comp_nid = NID_zlib_compression; cms = cms_CompressedData_create(comp_nid); if (!cms) return NULL; if(!(flags & CMS_DETACHED)) CMS_set_detached(cms, 0); if ((flags & CMS_STREAM) || CMS_fina...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
112,287,896,926,246,800,000,000,000,000,000,000,000
18
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) { CMSerr(CMS_F_CMS_UNCOMPRESS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); return 0; }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
115,016,829,229,254,600,000,000,000,000,000,000,000
6
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_compress(BIO *in, int comp_nid, unsigned int flags) { CMSerr(CMS_F_CMS_COMPRESS, CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); return NULL; }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
58,626,713,004,384,150,000,000,000,000,000,000,000
5
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static int cms_kari_set1_pkey(CMS_ContentInfo *cms, CMS_RecipientInfo *ri, EVP_PKEY *pk, X509 *cert) { int i; STACK_OF(CMS_RecipientEncryptedKey) *reks; CMS_RecipientEncryptedKey *rek; reks = CMS_RecipientInfo_kari_get0_reks(ri); if (!cert) return 0; for (i = 0; i < sk_CMS_RecipientEncryptedKey_num(reks)...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
36,202,890,096,089,780,000,000,000,000,000,000,000
24
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_EncryptedData_decrypt(CMS_ContentInfo *cms, const unsigned char *key, size_t keylen, BIO *dcont, BIO *out, unsigned int flags) { BIO *cont; int r; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_encrypted) { CMSerr(CMS_F_CMS_ENCRYPTEDDATA_DECRYPT, CMS_R_TYPE_NOT_ENCRYPTED_DATA); return 0...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
111,402,800,958,717,020,000,000,000,000,000,000,000
25
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static int cms_signerinfo_verify_cert(CMS_SignerInfo *si, X509_STORE *store, STACK_OF(X509) *certs, STACK_OF(X509_CRL) *crls, unsigned int flags) { X509_STORE_CTX ctx; X509 *signer; int i, j, r = 0; CMS_SignerInfo_get0_algs(si, NULL, &signer, NULL, NULL); if (!X509_STORE_CTX_init(&ctx, store, ...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
40,856,046,536,000,892,000,000,000,000,000,000,000
36
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static int cms_copy_content(BIO *out, BIO *in, unsigned int flags) { unsigned char buf[4096]; int r = 0, i; BIO *tmpout; tmpout = cms_get_text_bio(out, flags); if(!tmpout) { CMSerr(CMS_F_CMS_COPY_CONTENT,ERR_R_MALLOC_FAILURE); goto err; } /* Read all content through chain to process digest, decrypt et...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
209,044,444,940,073,750,000,000,000,000,000,000,000
51
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
static void do_free_upto(BIO *f, BIO *upto) { if (upto) { BIO *tbio; do { tbio = BIO_pop(f); BIO_free(f); f = tbio; } while (f && f != upto); } else BIO_free_all(f); }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
268,747,004,988,245,770,000,000,000,000,000,000,000
16
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) { BIO *cmsbio; int ret = 0; if (!(cmsbio = CMS_dataInit(cms, dcont))) { CMSerr(CMS_F_CMS_FINAL,ERR_R_MALLOC_FAILURE); return 0; } SMIME_crlf_copy(data, cmsbio, flags); (void)BIO_flush(cmsbio); if (!CMS_dataFinal(cms...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
50,657,657,261,475,540,000,000,000,000,000,000,000
29
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, BIO *data, unsigned int flags) { CMS_ContentInfo *cms; int i; cms = CMS_ContentInfo_new(); if (!cms || !CMS_SignedData_init(cms)) goto merr; if (pkey && !CMS_add1_signer(cms, signcert, pkey, NULL, flags)) { CMSerr(CMS_F...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
186,489,410,644,722,060,000,000,000,000,000,000,000
40
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_sign_receipt(CMS_SignerInfo *si, X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, unsigned int flags) { CMS_SignerInfo *rct_si; CMS_ContentInfo *cms = NULL; ASN1_OCTET_STRING **pos, *os; BIO *rct_cont = NULL; int r = 0; flags &= ~(CMS_STREAM|CMS_TEXT); /* Not really de...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
220,948,398,584,689,650,000,000,000,000,000,000,000
71
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
CMS_ContentInfo *CMS_encrypt(STACK_OF(X509) *certs, BIO *data, const EVP_CIPHER *cipher, unsigned int flags) { CMS_ContentInfo *cms; int i; X509 *recip; cms = CMS_EnvelopedData_create(cipher); if (!cms) goto merr; for (i = 0; i < sk_X509_num(certs); i++) { recip = sk_X509_value(certs, i); if (!CMS_ad...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
1,022,086,119,112,708,500,000,000,000,000,000,000
35
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_digest_verify(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) { BIO *cont; int r; if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_pkcs7_digest) { CMSerr(CMS_F_CMS_DIGEST_VERIFY, CMS_R_TYPE_NOT_DIGESTED_DATA); return 0; } if (!dcont && !check_content(cms)) return 0; cont = CMS...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
287,686,880,097,105,240,000,000,000,000,000,000,000
23
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_verify_receipt(CMS_ContentInfo *rcms, CMS_ContentInfo *ocms, STACK_OF(X509) *certs, X509_STORE *store, unsigned int flags) { int r; flags &= ~(CMS_DETACHED|CMS_TEXT); r = CMS_verify(rcms, certs, store, NULL, NULL, flags); if (r <= 0) return r; return cms_Receipt_verify(rcms, ocms); }
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
238,154,370,281,346,700,000,000,000,000,000,000,000
11
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, X509_STORE *store, BIO *dcont, BIO *out, unsigned int flags) { CMS_SignerInfo *si; STACK_OF(CMS_SignerInfo) *sinfos; STACK_OF(X509) *cms_certs = NULL; STACK_OF(X509_CRL) *crls = NULL; X509 *signer; int i, scount = 0, ret = 0; BIO *cmsbio = NULL, *tm...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
53,374,406,796,095,540,000,000,000,000,000,000,000
176
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
int CMS_decrypt_set1_key(CMS_ContentInfo *cms, unsigned char *key, size_t keylen, unsigned char *id, size_t idlen) { STACK_OF(CMS_RecipientInfo) *ris; CMS_RecipientInfo *ri; int i, r; ris = CMS_get0_RecipientInfos(cms); for (i = 0; i < sk_CMS_RecipientInfo_num(ris); i++) { ri = sk_CMS_RecipientInfo_v...
0
[ "CWE-399", "CWE-703" ]
openssl
cd30f03ac5bf2962f44bd02ae8d88245dff2f12c
186,487,594,653,213,130,000,000,000,000,000,000,000
38
Canonicalise input in CMS_verify. If content is detached and not binary mode translate the input to CRLF format. Before this change the input was verified verbatim which lead to a discrepancy between sign and verify.
BIGNUM *BN_mod_sqrt(BIGNUM *in, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx) /* * Returns 'ret' such that ret^2 == a (mod p), using the Tonelli/Shanks * algorithm (cf. Henri Cohen, "A Course in Algebraic Computational Number * Theory", algorithm 1.5.1). 'p' must be prime, otherwise an error or * an incorrect "res...
0
[]
openssl
9eafb53614bf65797db25f467946e735e1b43dc9
336,344,315,856,147,520,000,000,000,000,000,000,000
356
Fix possible infinite loop in BN_mod_sqrt() The calculation in some cases does not finish for non-prime p. This fixes CVE-2022-0778. Based on patch by David Benjamin <davidben@google.com>. Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
void loongarch_cpu_dump_state(CPUState *cs, FILE *f, int flags) { LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; int i; qemu_fprintf(f, " PC=%016" PRIx64 " ", env->pc); qemu_fprintf(f, " FCSR0 0x%08x fp_status 0x%02x\n", env->fcsr0, get_float_exception_...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
187,334,785,086,860,350,000,000,000,000,000,000,000
46
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_do_interrupt(CPUState *cs) { LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; bool update_badinstr = 1; int cause = -1; const char *name; bool tlbfill = FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR); uint32_t vec_size = FIELD_EX64(env->...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
116,728,245,970,715,190,000,000,000,000,000,000,000
138
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_init(Object *obj) { LoongArchCPU *cpu = LOONGARCH_CPU(obj); cpu_set_cpustate_pointers(cpu); #ifndef CONFIG_USER_ONLY CPULoongArchState *env = &cpu->env; qdev_init_gpio_in(DEVICE(cpu), loongarch_cpu_set_irq, N_IRQS); timer_init_ns(&cpu->timer, QEMU_CLOCK_VIRTUAL, ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
141,583,391,487,584,120,000,000,000,000,000,000,000
19
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_class_init(ObjectClass *c, void *data) { LoongArchCPUClass *lacc = LOONGARCH_CPU_CLASS(c); CPUClass *cc = CPU_CLASS(c); DeviceClass *dc = DEVICE_CLASS(c); device_class_set_parent_realize(dc, loongarch_cpu_realizefn, &lacc->parent_realize); ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
336,065,939,033,287,480,000,000,000,000,000,000,000
30
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
void G_NORETURN do_raise_exception(CPULoongArchState *env, uint32_t exception, uintptr_t pc) { CPUState *cs = env_cpu(env); qemu_log_mask(CPU_LOG_INT, "%s: %d (%s)\n", __func__, exception, ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
285,871,588,490,941,750,000,000,000,000,000,000,000
14
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_list_entry(gpointer data, gpointer user_data) { const char *typename = object_class_get_name(OBJECT_CLASS(data)); qemu_printf("%s\n", typename); }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
126,598,212,362,212,010,000,000,000,000,000,000,000
6
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
const char *loongarch_exception_name(int32_t exception) { assert(excp_names[exception]); return excp_names[exception]; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
301,706,025,962,126,700,000,000,000,000,000,000,000
5
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_disas_set_info(CPUState *s, disassemble_info *info) { info->print_insn = print_insn_loongarch; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
248,390,498,593,229,640,000,000,000,000,000,000,000
4
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
void loongarch_cpu_set_irq(void *opaque, int irq, int level) { LoongArchCPU *cpu = opaque; CPULoongArchState *env = &cpu->env; CPUState *cs = CPU(cpu); if (irq < 0 || irq >= N_IRQS) { return; } env->CSR_ESTAT = deposit64(env->CSR_ESTAT, irq, 1, level != 0); if (FIELD_EX64(env->CSR...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
317,971,524,658,870,480,000,000,000,000,000,000,000
18
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_reset(DeviceState *dev) { CPUState *cs = CPU(dev); LoongArchCPU *cpu = LOONGARCH_CPU(cs); LoongArchCPUClass *lacc = LOONGARCH_CPU_GET_CLASS(cpu); CPULoongArchState *env = &cpu->env; lacc->parent_reset(dev); env->fcsr0_mask = FCSR0_M1 | FCSR0_M2 | FCSR0_M3; env->fc...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
93,608,174,149,963,210,000,000,000,000,000,000,000
58
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_set_pc(CPUState *cs, vaddr value) { LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; env->pc = value; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
24,210,562,096,257,856,000,000,000,000,000,000,000
7
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_do_transaction_failed(CPUState *cs, hwaddr physaddr, vaddr addr, unsigned size, MMUAccessType access_type, int mmu_idx, MemTxAttrs attrs, ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
33,642,872,294,703,816,000,000,000,000,000,000,000
16
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static inline bool cpu_loongarch_hw_interrupts_enabled(CPULoongArchState *env) { bool ret = 0; ret = (FIELD_EX64(env->CSR_CRMD, CSR_CRMD, IE) && !(FIELD_EX64(env->CSR_DBG, CSR_DBG, DST))); return ret; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
157,106,311,556,424,010,000,000,000,000,000,000,000
9
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_qemu_write(void *opaque, hwaddr addr, uint64_t val, unsigned size) { }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
29,091,883,490,871,030,000,000,000,000,000,000,000
4
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
void loongarch_cpu_list(void) { GSList *list; list = object_class_get_list_sorted(TYPE_LOONGARCH_CPU, false); g_slist_foreach(list, loongarch_cpu_list_entry, NULL); g_slist_free(list); }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
287,661,730,287,985,850,000,000,000,000,000,000,000
7
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_realizefn(DeviceState *dev, Error **errp) { CPUState *cs = CPU(dev); LoongArchCPUClass *lacc = LOONGARCH_CPU_GET_CLASS(dev); Error *local_err = NULL; cpu_exec_realizefn(cs, &local_err); if (local_err != NULL) { error_propagate(errp, local_err); return; ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
306,469,939,481,004,900,000,000,000,000,000,000,000
19
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static uint64_t loongarch_qemu_read(void *opaque, hwaddr addr, unsigned size) { switch (addr) { case FEATURE_REG: return 1ULL << IOCSRF_MSI | 1ULL << IOCSRF_EXTIOI | 1ULL << IOCSRF_CSRIPI; case VENDOR_REG: return 0x6e6f73676e6f6f4cULL; /* "Loongson" */ case CPUNAME_REG: ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
317,660,959,759,396,130,000,000,000,000,000,000,000
15
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_la464_initfn(Object *obj) { LoongArchCPU *cpu = LOONGARCH_CPU(obj); CPULoongArchState *env = &cpu->env; int i; for (i = 0; i < 21; i++) { env->cpucfg[i] = 0x0; } env->cpucfg[0] = 0x14c010; /* PRID */ uint32_t data = 0; data = FIELD_DP32(data, CPUCFG1, AR...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
9,601,102,786,029,139,000,000,000,000,000,000,000
80
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static inline bool cpu_loongarch_hw_interrupts_pending(CPULoongArchState *env) { uint32_t pending; uint32_t status; bool r; pending = FIELD_EX64(env->CSR_ESTAT, CSR_ESTAT, IS); status = FIELD_EX64(env->CSR_ECFG, CSR_ECFG, LIE); r = (pending & status) != 0; return r; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
90,934,617,445,509,440,000,000,000,000,000,000,000
12
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static ObjectClass *loongarch_cpu_class_by_name(const char *cpu_model) { ObjectClass *oc; char *typename; typename = g_strdup_printf(LOONGARCH_CPU_TYPE_NAME("%s"), cpu_model); oc = object_class_by_name(typename); g_free(typename); return oc; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
305,153,526,844,854,970,000,000,000,000,000,000,000
10
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
CpuDefinitionInfoList *qmp_query_cpu_definitions(Error **errp) { CpuDefinitionInfoList *cpu_list = NULL; GSList *list; list = object_class_get_list(TYPE_LOONGARCH_CPU, false); g_slist_foreach(list, loongarch_cpu_add_definition, &cpu_list); g_slist_free(list); return cpu_list; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
56,328,616,090,786,580,000,000,000,000,000,000,000
11
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static bool loongarch_cpu_exec_interrupt(CPUState *cs, int interrupt_request) { if (interrupt_request & CPU_INTERRUPT_HARD) { LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; if (cpu_loongarch_hw_interrupts_enabled(env) && cpu_loongarch_hw_interrupts_pe...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
308,599,394,633,213,120,000,000,000,000,000,000,000
16
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static bool loongarch_cpu_has_work(CPUState *cs) { #ifdef CONFIG_USER_ONLY return true; #else LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; bool has_work = false; if ((cs->interrupt_request & CPU_INTERRUPT_HARD) && cpu_loongarch_hw_interrupts_pending(env)) { ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
301,843,980,364,088,500,000,000,000,000,000,000,000
17
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_add_definition(gpointer data, gpointer user_data) { ObjectClass *oc = data; CpuDefinitionInfoList **cpu_list = user_data; CpuDefinitionInfo *info = g_new0(CpuDefinitionInfo, 1); const char *typename = object_class_get_name(oc); info->name = g_strndup(typename, ...
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
219,820,574,007,661,160,000,000,000,000,000,000,000
13
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...
static void loongarch_cpu_synchronize_from_tb(CPUState *cs, const TranslationBlock *tb) { LoongArchCPU *cpu = LOONGARCH_CPU(cs); CPULoongArchState *env = &cpu->env; env->pc = tb->pc; }
0
[]
qemu
3517fb726741c109cae7995f9ea46f0cab6187d6
58,198,766,634,163,720,000,000,000,000,000,000,000
8
target/loongarch: Clean up tlb when cpu reset We should make sure that tlb is clean when cpu reset. Signed-off-by: Song Gao <gaosong@loongson.cn> Message-Id: <20220705070950.2364243-1-gaosong@loongson.cn> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Richard Henderson <richard.henderson...