summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaiki Ueno <ueno@gnu.org>2020-05-25 18:37:51 +0200
committerDaiki Ueno <ueno@gnu.org>2020-05-29 17:24:34 +0200
commit5b4989dc8e292b4a7e66ee3a1d6be7ad3abf6654 (patch)
tree127c803c30f6a086de824b08c7ea31f9415bcdbe /src
parent43349cda523f90bc97e43dd86ca1171262a0086c (diff)
downloadgnutls-5b4989dc8e292b4a7e66ee3a1d6be7ad3abf6654.tar.gz
gnulib: update git submodule
This brings in the new fopen-gnu module and the RF_SENSITIVE flag for fread_file and read_file. This also adds the following changes to be consistent with the latest changes in Gnulib: - the callers of fread_file and read_file to be adjusted for the FLAGS argument - "attribute.h" needs to be used extensively Signed-off-by: Daiki Ueno <ueno@gnu.org>
Diffstat (limited to 'src')
-rw-r--r--src/certtool-common.c14
-rw-r--r--src/certtool.c28
-rw-r--r--src/cli.c2
-rw-r--r--src/ocsptool.c17
4 files changed, 29 insertions, 32 deletions
diff --git a/src/certtool-common.c b/src/certtool-common.c
index c76352c9d8..ade6b1b569 100644
--- a/src/certtool-common.c
+++ b/src/certtool-common.c
@@ -270,7 +270,7 @@ gnutls_privkey_t load_private_key(int mand, common_info_st * info)
if (gnutls_url_is_supported(info->privkey) != 0)
return _load_url_privkey(info->privkey);
- dat.data = (void *) read_binary_file(info->privkey, &size);
+ dat.data = (void *) read_file(info->privkey, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -313,7 +313,7 @@ load_x509_private_key(int mand, common_info_st * info)
app_exit(1);
}
- dat.data = (void *) read_binary_file(info->privkey, &size);
+ dat.data = (void *) read_file(info->privkey, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -519,7 +519,7 @@ gnutls_x509_crq_t load_request(common_info_st * info)
app_exit(1);
}
- dat.data = (void *) read_binary_file(info->request, &size);
+ dat.data = (void *) read_file(info->request, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -560,7 +560,7 @@ gnutls_privkey_t load_ca_private_key(common_info_st * info)
if (gnutls_url_is_supported(info->ca_privkey) != 0)
return _load_url_privkey(info->ca_privkey);
- dat.data = (void *) read_binary_file(info->ca_privkey, &size);
+ dat.data = (void *) read_file(info->ca_privkey, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -610,7 +610,7 @@ gnutls_x509_crt_t load_ca_cert(unsigned mand, common_info_st * info)
return crt;
}
- dat.data = (void *) read_binary_file(info->ca, &size);
+ dat.data = (void *) read_file(info->ca, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -657,7 +657,7 @@ gnutls_pubkey_t load_pubkey(int mand, common_info_st * info)
app_exit(1);
}
- dat.data = (void *) read_binary_file(info->pubkey, &size);
+ dat.data = (void *) read_file(info->pubkey, RF_BINARY, &size);
dat.size = size;
if (!dat.data) {
@@ -1090,7 +1090,7 @@ void dh_info(FILE * infile, FILE * outfile, common_info_st * ci)
app_exit(1);
}
- params.data = (void *) fread_file(infile, &size);
+ params.data = (void *) fread_file(infile, 0, &size);
params.size = size;
if (params.data == NULL) {
diff --git a/src/certtool.c b/src/certtool.c
index a46f774114..0e24ac8281 100644
--- a/src/certtool.c
+++ b/src/certtool.c
@@ -1530,7 +1530,7 @@ void certificate_info(int pubkey, common_info_st * cinfo)
gnutls_datum_t pem;
unsigned int crt_num;
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
@@ -1651,7 +1651,7 @@ void crl_info(common_info_st *cinfo)
app_exit(1);
}
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
@@ -1723,7 +1723,7 @@ void crq_info(common_info_st *cinfo)
app_exit(1);
}
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
@@ -2241,7 +2241,7 @@ static void load_data(common_info_st *cinfo, gnutls_datum_t *data)
app_exit(1);
}
- data->data = (void *) fread_file(fp, &size);
+ data->data = (void *) fread_file(fp, 0, &size);
if (data->data == NULL) {
fprintf(stderr, "Error reading data file");
app_exit(1);
@@ -2513,7 +2513,7 @@ static void verify_chain(common_info_st * cinfo)
app_exit(1);
}
- buf = (void *) fread_file(infile, &size);
+ buf = (void *) fread_file(infile, 0, &size);
if (buf == NULL) {
fprintf(stderr, "Error reading certificate chain");
app_exit(1);
@@ -2530,7 +2530,7 @@ static void verify_certificate(common_info_st * cinfo)
char *cas = NULL;
size_t cert_size;
- cert = (void *) fread_file(infile, &cert_size);
+ cert = (void *) fread_file(infile, 0, &cert_size);
if (cert == NULL) {
fprintf(stderr, "Error reading certificate chain");
app_exit(1);
@@ -2573,7 +2573,7 @@ void verify_crl(common_info_st * cinfo)
app_exit(1);
}
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
@@ -2661,7 +2661,7 @@ void verify_pkcs7(common_info_st * cinfo, const char *purpose, unsigned display_
app_exit(1);
}
- data.data = (void *) fread_file(infile, &size);
+ data.data = (void *) fread_file(infile, 0, &size);
data.size = size;
if (!data.data) {
@@ -2785,7 +2785,7 @@ void pkcs7_sign(common_info_st * cinfo, unsigned embed)
app_exit(1);
}
- data.data = (void *) fread_file(infile, &size);
+ data.data = (void *) fread_file(infile, 0, &size);
data.size = size;
if (!data.data) {
@@ -3404,7 +3404,7 @@ void pkcs12_info(common_info_st * cinfo)
app_exit(1);
}
- data.data = (void *) fread_file(infile, &size);
+ data.data = (void *) fread_file(infile, 0, &size);
data.size = size;
if (!data.data) {
@@ -3593,7 +3593,7 @@ void pkcs8_info(void)
size_t size;
gnutls_datum_t data;
- data.data = (void *) fread_file(infile, &size);
+ data.data = (void *) fread_file(infile, 0, &size);
data.size = size;
if (!data.data) {
@@ -3618,7 +3618,7 @@ void pkcs7_info(common_info_st *cinfo, unsigned display_data)
app_exit(1);
}
- data.data = (void *) fread_file(infile, &size);
+ data.data = (void *) fread_file(infile, 0, &size);
data.size = size;
if (!data.data) {
@@ -3787,7 +3787,7 @@ gnutls_pubkey_t find_pubkey(gnutls_x509_crt_t crt, common_info_st * cinfo)
pubkey = load_pubkey(0, cinfo);
if (pubkey == NULL) { /* load from stdin */
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
@@ -3931,7 +3931,7 @@ void certificate_fpr(common_info_st * cinfo)
crt = load_cert(0, cinfo);
if (crt == NULL) {
- pem.data = (void *) fread_file(infile, &size);
+ pem.data = (void *) fread_file(infile, 0, &size);
pem.size = size;
if (!pem.data) {
diff --git a/src/cli.c b/src/cli.c
index c3d074f084..cf0ef2ac98 100644
--- a/src/cli.c
+++ b/src/cli.c
@@ -1036,7 +1036,7 @@ static int try_resume(socket_st * hd)
fprintf(stderr, "could not open %s\n", OPT_ARG(EARLYDATA));
exit(1);
}
- edata.data = (void *) fread_file(fp, &size);
+ edata.data = (void *) fread_file(fp, 0, &size);
edata.size = size;
fclose(fp);
}
diff --git a/src/ocsptool.c b/src/ocsptool.c
index 3b7940962c..a963de039a 100644
--- a/src/ocsptool.c
+++ b/src/ocsptool.c
@@ -99,10 +99,9 @@ static void request_info(void)
if (HAVE_OPT(LOAD_REQUEST))
dat.data =
- (void *) read_binary_file(OPT_ARG(LOAD_REQUEST),
- &size);
+ (void *) read_file(OPT_ARG(LOAD_REQUEST), RF_BINARY, &size);
else
- dat.data = (void *) fread_file(infile, &size);
+ dat.data = (void *) fread_file(infile, 0, &size);
if (dat.data == NULL) {
fprintf(stderr, "error reading request\n");
app_exit(1);
@@ -236,10 +235,9 @@ static void response_info(void)
if (HAVE_OPT(LOAD_RESPONSE))
dat.data =
- (void *) read_binary_file(OPT_ARG(LOAD_RESPONSE),
- &size);
+ (void *) read_file(OPT_ARG(LOAD_RESPONSE), RF_BINARY, &size);
else
- dat.data = (void *) fread_file(infile, &size);
+ dat.data = (void *) fread_file(infile, 0, &size);
if (dat.data == NULL) {
fprintf(stderr, "error reading response\n");
app_exit(1);
@@ -348,7 +346,7 @@ static int _verify_response(gnutls_datum_t * data, gnutls_datum_t * nonce,
if (HAVE_OPT(LOAD_TRUST)) {
dat.data =
- (void *) read_binary_file(OPT_ARG(LOAD_TRUST), &size);
+ (void *) read_file(OPT_ARG(LOAD_TRUST), RF_BINARY, &size);
if (dat.data == NULL) {
fprintf(stderr, "error reading --load-trust: %s\n",
OPT_ARG(LOAD_TRUST));
@@ -524,10 +522,9 @@ static void verify_response(gnutls_datum_t *nonce)
if (HAVE_OPT(LOAD_RESPONSE))
dat.data =
- (void *) read_binary_file(OPT_ARG(LOAD_RESPONSE),
- &size);
+ (void *) read_file(OPT_ARG(LOAD_RESPONSE), RF_BINARY, &size);
else
- dat.data = (void *) fread_file(infile, &size);
+ dat.data = (void *) fread_file(infile, 0, &size);
if (dat.data == NULL) {
fprintf(stderr, "error reading response\n");
app_exit(1);