mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
Merge pull request #331 from jopadan/master
silence signedness warnings and errors
This commit is contained in:
commit
408c4e34d4
8
src/cache/cache.c
vendored
8
src/cache/cache.c
vendored
@ -950,7 +950,7 @@ check_sha(const char *name, const unsigned char *data, size_t len, const char *c
|
|||||||
mdctx = EVP_MD_CTX_new();
|
mdctx = EVP_MD_CTX_new();
|
||||||
EVP_DigestInit_ex(mdctx, md, NULL);
|
EVP_DigestInit_ex(mdctx, md, NULL);
|
||||||
EVP_DigestUpdate(mdctx, data, len);
|
EVP_DigestUpdate(mdctx, data, len);
|
||||||
EVP_DigestFinal_ex(mdctx, md_value, &md_len);
|
EVP_DigestFinal_ex(mdctx, md_value, (unsigned int*)&md_len);
|
||||||
EVP_MD_CTX_free(mdctx);
|
EVP_MD_CTX_free(mdctx);
|
||||||
int outlen = 0;
|
int outlen = 0;
|
||||||
unsigned char *b64 = base64_encode_bin(md_value, md_len, &outlen);
|
unsigned char *b64 = base64_encode_bin(md_value, md_len, &outlen);
|
||||||
@ -983,13 +983,13 @@ validate_cache_integrity(struct cache_entry *cached, const char *integrity)
|
|||||||
|
|
||||||
if (!strncmp("sha512-", ch, 7)) {
|
if (!strncmp("sha512-", ch, 7)) {
|
||||||
ch += 7;
|
ch += 7;
|
||||||
ret = check_sha("sha512", frag->data, frag->length, ch);
|
ret = check_sha("sha512", (const unsigned char*)frag->data, frag->length, ch);
|
||||||
} else if (!strncmp("sha384-", ch, 7)) {
|
} else if (!strncmp("sha384-", ch, 7)) {
|
||||||
ch += 7;
|
ch += 7;
|
||||||
ret = check_sha("sha384", frag->data, frag->length, ch);
|
ret = check_sha("sha384", (const unsigned char*)frag->data, frag->length, ch);
|
||||||
} else if (!strncmp("sha256-", ch, 7)) {
|
} else if (!strncmp("sha256-", ch, 7)) {
|
||||||
ch += 7;
|
ch += 7;
|
||||||
ret = check_sha("sha256", frag->data, frag->length, ch);
|
ret = check_sha("sha256", (const unsigned char*)frag->data, frag->length, ch);
|
||||||
}
|
}
|
||||||
if (ret) {
|
if (ret) {
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -2423,8 +2423,8 @@ el_match_selector(const char *selector, void *node)
|
|||||||
{
|
{
|
||||||
struct string text;
|
struct string text;
|
||||||
css_error code;
|
css_error code;
|
||||||
size_t size;
|
//size_t size;
|
||||||
uint32_t count;
|
//uint32_t count;
|
||||||
css_stylesheet_params params;
|
css_stylesheet_params params;
|
||||||
css_stylesheet *sheet = NULL;
|
css_stylesheet *sheet = NULL;
|
||||||
css_select_ctx *select_ctx = NULL;
|
css_select_ctx *select_ctx = NULL;
|
||||||
|
@ -187,7 +187,7 @@ cont:
|
|||||||
|
|
||||||
if (form->dontsave) continue;
|
if (form->dontsave) continue;
|
||||||
|
|
||||||
enc_value = *value ? base64_decode(value)
|
enc_value = *value ? (char*)base64_decode((unsigned char*)value)
|
||||||
: stracpy(value);
|
: stracpy(value);
|
||||||
if (!enc_value) goto fail;
|
if (!enc_value) goto fail;
|
||||||
|
|
||||||
@ -253,7 +253,7 @@ save_formhist_to_file(void)
|
|||||||
* $ cat ~/.config/elinks/formhist
|
* $ cat ~/.config/elinks/formhist
|
||||||
* we don't want someone behind our back to read our
|
* we don't want someone behind our back to read our
|
||||||
* password (androids don't count). */
|
* password (androids don't count). */
|
||||||
encvalue = base64_encode(sv->value);
|
encvalue = (char*)base64_encode((unsigned char*)sv->value);
|
||||||
} else {
|
} else {
|
||||||
encvalue = stracpy("");
|
encvalue = stracpy("");
|
||||||
}
|
}
|
||||||
|
@ -137,7 +137,7 @@ data_protocol_handler(struct connection *conn)
|
|||||||
|
|
||||||
datalen = uri->datalen - (data_start - uri->data);
|
datalen = uri->datalen - (data_start - uri->data);
|
||||||
if (base64) {
|
if (base64) {
|
||||||
char *decoded = base64_decode_bin(data_start, datalen, &decodedlen);
|
char *decoded = (char*)base64_decode_bin((const unsigned char*)data_start, datalen, &decodedlen);
|
||||||
|
|
||||||
if (!decoded) {
|
if (!decoded) {
|
||||||
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
abort_connection(conn, connection_state(S_OUT_OF_MEM));
|
||||||
|
@ -814,7 +814,7 @@ http_send_header(struct socket *socket)
|
|||||||
|
|
||||||
proxy_data = straconcat(user, ":", passwd, (char *) NULL);
|
proxy_data = straconcat(user, ":", passwd, (char *) NULL);
|
||||||
if (proxy_data) {
|
if (proxy_data) {
|
||||||
char *proxy_64 = base64_encode(proxy_data);
|
char *proxy_64 = (char*)base64_encode((unsigned char*)proxy_data);
|
||||||
|
|
||||||
if (proxy_64) {
|
if (proxy_64) {
|
||||||
add_to_string(&header, "Proxy-Authorization: Basic ");
|
add_to_string(&header, "Proxy-Authorization: Basic ");
|
||||||
@ -1032,7 +1032,7 @@ http_send_header(struct socket *socket)
|
|||||||
id = straconcat(entry->user, ":", entry->password,
|
id = straconcat(entry->user, ":", entry->password,
|
||||||
(char *) NULL);
|
(char *) NULL);
|
||||||
if (id) {
|
if (id) {
|
||||||
char *base64 = base64_encode(id);
|
char *base64 = (char*)base64_encode((unsigned char*)id);
|
||||||
|
|
||||||
mem_free_set(&id, base64);
|
mem_free_set(&id, base64);
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,7 @@ base64_encode(unsigned char *in)
|
|||||||
assert(in && *in);
|
assert(in && *in);
|
||||||
if_assert_failed return NULL;
|
if_assert_failed return NULL;
|
||||||
|
|
||||||
return base64_encode_bin(in, strlen(in), NULL);
|
return base64_encode_bin(in, strlen((const char*)in), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char *
|
unsigned char *
|
||||||
@ -69,7 +69,7 @@ base64_decode(const unsigned char *in)
|
|||||||
assert(in && *in);
|
assert(in && *in);
|
||||||
if_assert_failed return NULL;
|
if_assert_failed return NULL;
|
||||||
|
|
||||||
return base64_decode_bin(in, strlen(in), NULL);
|
return base64_decode_bin(in, strlen((const char*)in), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Decode a Base64 string.
|
/** Decode a Base64 string.
|
||||||
|
Loading…
Reference in New Issue
Block a user