From: Nikos Mavrogiannopoulos Date: Sat, 21 Jan 2012 00:21:40 +0000 (+0100) Subject: sign fixes. X-Git-Tag: gnutls_3_0_13~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d00e8e431d59556d46c43acb2d43957d67033b4a;p=thirdparty%2Fgnutls.git sign fixes. --- diff --git a/doc/examples/ex-ocsp-client.c b/doc/examples/ex-ocsp-client.c index 79088dec9e..6d8f080f41 100644 --- a/doc/examples/ex-ocsp-client.c +++ b/doc/examples/ex-ocsp-client.c @@ -40,7 +40,7 @@ main (int argc, char *argv[]) if (rc < 0) goto done; - certdata.data = read_binary_file (argv[1], &s); + certdata.data = (void*)read_binary_file (argv[1], &s); if (certdata.data == NULL) { printf ("cannot read certificate\n"); @@ -113,7 +113,7 @@ main (int argc, char *argv[]) if (rc < 0) goto done; - issuerdata.data = read_binary_file (argv[2], &s); + issuerdata.data = (void*)read_binary_file (argv[2], &s); if (issuerdata.data == NULL) { printf ("cannot read issuer\n"); diff --git a/doc/examples/ex-ocsp-verify.c b/doc/examples/ex-ocsp-verify.c index 37a2122fd9..b023ac3d77 100644 --- a/doc/examples/ex-ocsp-verify.c +++ b/doc/examples/ex-ocsp-verify.c @@ -41,7 +41,7 @@ main (int argc, char *argv[]) if (rc < 0) goto done; - tmp.data = read_binary_file (argv[1], &s); + tmp.data = (void*)read_binary_file (argv[1], &s); if (tmp.data == NULL) { printf ("cannot read OCSP response\n"); @@ -74,7 +74,7 @@ main (int argc, char *argv[]) if (rc < 0) goto done; - tmp.data = read_binary_file (argv[2], &s); + tmp.data = (void*)read_binary_file (argv[2], &s); if (tmp.data == NULL) { printf ("cannot read OCSP response\n"); diff --git a/lib/x509/ocsp.c b/lib/x509/ocsp.c index ae2316822d..732a99e04c 100644 --- a/lib/x509/ocsp.c +++ b/lib/x509/ocsp.c @@ -410,7 +410,7 @@ gnutls_ocsp_resp_export (gnutls_ocsp_resp_t resp, gnutls_datum_t * data) int gnutls_ocsp_req_get_version (gnutls_ocsp_req_t req) { - opaque version[8]; + uint8_t version[8]; int len, ret; if (req == NULL) @@ -491,7 +491,7 @@ gnutls_ocsp_req_get_cert_id (gnutls_ocsp_req_t req, return ret; } - ret = _gnutls_x509_oid2digest_algorithm (sa.data); + ret = _gnutls_x509_oid2digest_algorithm ((char*)sa.data); _gnutls_free_datum (&sa); if (ret < 0) { @@ -688,8 +688,8 @@ gnutls_ocsp_req_add_cert (gnutls_ocsp_req_t req, { int ret; gnutls_datum_t sn, tmp, inh, ikh; - char inh_buf[MAX_HASH_SIZE]; - char ikh_buf[MAX_HASH_SIZE]; + uint8_t inh_buf[MAX_HASH_SIZE]; + uint8_t ikh_buf[MAX_HASH_SIZE]; size_t inhlen = MAX_HASH_SIZE; size_t ikhlen = MAX_HASH_SIZE; @@ -1013,7 +1013,7 @@ int gnutls_ocsp_req_randomize_nonce (gnutls_ocsp_req_t req) { int ret; - char rndbuf[23]; + uint8_t rndbuf[23]; gnutls_datum_t nonce = { rndbuf, sizeof (rndbuf) }; if (req == NULL) @@ -1052,7 +1052,7 @@ gnutls_ocsp_req_randomize_nonce (gnutls_ocsp_req_t req) int gnutls_ocsp_resp_get_status (gnutls_ocsp_resp_t resp) { - opaque str[1]; + uint8_t str[1]; int len, ret; if (resp == NULL) @@ -1156,7 +1156,7 @@ gnutls_ocsp_resp_get_response (gnutls_ocsp_resp_t resp, int gnutls_ocsp_resp_get_version (gnutls_ocsp_resp_t resp) { - opaque version[8]; + uint8_t version[8]; int len, ret; if (resp == NULL) @@ -1225,7 +1225,7 @@ gnutls_ocsp_resp_get_responder (gnutls_ocsp_resp_t resp, ret = _gnutls_x509_parse_dn (resp->basicresp, "tbsResponseData.responderID.byName", - dn->data, &l); + (char*)dn->data, &l); if (ret != GNUTLS_E_SUCCESS) { gnutls_assert (); @@ -1353,7 +1353,7 @@ gnutls_ocsp_resp_get_single (gnutls_ocsp_resp_t resp, return ret; } - ret = _gnutls_x509_oid2digest_algorithm (sa.data); + ret = _gnutls_x509_oid2digest_algorithm ((char*)sa.data); _gnutls_free_datum (&sa); if (ret < 0) { @@ -1682,7 +1682,7 @@ gnutls_ocsp_resp_get_signature_algorithm (gnutls_ocsp_resp_t resp) return ret; } - ret = _gnutls_x509_oid2sign_algorithm (sa.data); + ret = _gnutls_x509_oid2sign_algorithm ((char*)sa.data); _gnutls_free_datum (&sa); diff --git a/lib/x509/ocsp_output.c b/lib/x509/ocsp_output.c index 719ce89543..e1bdf82953 100644 --- a/lib/x509/ocsp_output.c +++ b/lib/x509/ocsp_output.c @@ -137,11 +137,11 @@ print_req (gnutls_buffer_st * str, gnutls_ocsp_req_t req) critical ? "critical" : "not critical"); addf (str, _("\t\t\tASCII: ")); - _gnutls_buffer_asciiprint (str, data.data, data.size); + _gnutls_buffer_asciiprint (str, (char*)data.data, data.size); addf (str, "\n"); addf (str, _("\t\t\tHexdump: ")); - _gnutls_buffer_hexprint (str, data.data, data.size); + _gnutls_buffer_hexprint (str, (char*)data.data, data.size); adds (str, "\n"); } @@ -484,11 +484,11 @@ print_resp (gnutls_buffer_st * str, gnutls_ocsp_resp_t resp) critical ? "critical" : "not critical"); addf (str, _("\t\t\tASCII: ")); - _gnutls_buffer_asciiprint (str, data.data, data.size); + _gnutls_buffer_asciiprint (str, (char*)data.data, data.size); addf (str, "\n"); addf (str, _("\t\t\tHexdump: ")); - _gnutls_buffer_hexprint (str, data.data, data.size); + _gnutls_buffer_hexprint (str, (char*)data.data, data.size); adds (str, "\n"); } diff --git a/src/ocsptool.c b/src/ocsptool.c index dde1028480..bd35a102b5 100644 --- a/src/ocsptool.c +++ b/src/ocsptool.c @@ -62,9 +62,9 @@ request_info (void) error (EXIT_FAILURE, 0, "ocsp_req_init: %s", gnutls_strerror (ret)); if (info.req) - dat.data = read_binary_file (info.req, &size); + dat.data = (void*)read_binary_file (info.req, &size); else - dat.data = fread_file (infile, &size); + dat.data = (void*)fread_file (infile, &size); if (dat.data == NULL) error (EXIT_FAILURE, errno, "reading request"); dat.size = size; @@ -97,9 +97,9 @@ response_info (void) error (EXIT_FAILURE, 0, "ocsp_resp_init: %s", gnutls_strerror (ret)); if (info.resp) - dat.data = read_binary_file (info.resp, &size); + dat.data = (void*)read_binary_file (info.resp, &size); else - dat.data = fread_file (infile, &size); + dat.data = (void*)fread_file (infile, &size); if (dat.data == NULL) error (EXIT_FAILURE, errno, "reading response"); dat.size = size; @@ -134,7 +134,7 @@ load_issuer (void) if (ret < 0) error (EXIT_FAILURE, 0, "crt_init: %s", gnutls_strerror (ret)); - dat.data = read_binary_file (info.issuer, &size); + dat.data = (void*)read_binary_file (info.issuer, &size); dat.size = size; if (!dat.data) @@ -164,7 +164,7 @@ load_cert (void) if (ret < 0) error (EXIT_FAILURE, 0, "crt_init: %s", gnutls_strerror (ret)); - dat.data = read_binary_file (info.cert, &size); + dat.data = (void*)read_binary_file (info.cert, &size); dat.size = size; if (!dat.data) @@ -204,7 +204,7 @@ generate_request (void) if (!info.nononce) { - char noncebuf[23]; + unsigned char noncebuf[23]; gnutls_datum_t nonce = { noncebuf, sizeof (noncebuf) }; ret = gnutls_rnd (GNUTLS_RND_RANDOM, nonce.data, nonce.size); @@ -319,9 +319,9 @@ verify_response (void) error (EXIT_FAILURE, 0, "ocsp_resp_init: %s", gnutls_strerror (ret)); if (info.resp) - dat.data = read_binary_file (info.resp, &size); + dat.data = (void*)read_binary_file (info.resp, &size); else - dat.data = fread_file (infile, &size); + dat.data = (void*)fread_file (infile, &size); if (dat.data == NULL) error (EXIT_FAILURE, errno, "reading response"); dat.size = size; @@ -335,7 +335,7 @@ verify_response (void) error (EXIT_FAILURE, 0, "cannot mix --load-trust and --load-signer"); else if (info.signer == NULL) { - dat.data = read_binary_file (info.trust, &size); + dat.data = (void*)read_binary_file (info.trust, &size); if (dat.data == NULL) error (EXIT_FAILURE, errno, "reading --load-trust: %s", info.trust); dat.size = size; @@ -388,7 +388,7 @@ verify_response (void) if (ret < 0) error (EXIT_FAILURE, 0, "crt_init: %s", gnutls_strerror (ret)); - dat.data = read_binary_file (info.signer, &size); + dat.data = (void*)read_binary_file (info.signer, &size); if (dat.data == NULL) error (EXIT_FAILURE, errno, "reading --load-signer: %s", info.signer); dat.size = size;