summaryrefslogtreecommitdiff
path: root/lib/gnutls_x509.c
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2004-10-05 19:23:32 +0000
committerSimon Josefsson <simon@josefsson.org>2004-10-05 19:23:32 +0000
commit44f36671ed0ea24b60afdf8a033faf3d258a24c3 (patch)
treee69dca84aa9ed595fc218bb536091f2112b875f9 /lib/gnutls_x509.c
parentc959c9d135876d62dc00f743c27f23cb4b30f74c (diff)
downloadgnutls-44f36671ed0ea24b60afdf8a033faf3d258a24c3.tar.gz
Update Gnulib.
Replace memstr with memmem, see continued discussion on bug-gnulib.
Diffstat (limited to 'lib/gnutls_x509.c')
-rw-r--r--lib/gnutls_x509.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/lib/gnutls_x509.c b/lib/gnutls_x509.c
index e5dc7e5229..f5d59e2958 100644
--- a/lib/gnutls_x509.c
+++ b/lib/gnutls_x509.c
@@ -438,8 +438,8 @@ static int parse_pem_cert_mem(gnutls_cert ** cert_list, uint * ncerts,
int ret, count;
#ifdef ENABLE_PKI
- if ((ptr =
- memstr(input_cert, PEM_PKCS7_SEP, input_cert_size)) != NULL) {
+ if ((ptr = memmem(input_cert, input_cert_size,
+ PEM_PKCS7_SEP, sizeof (PEM_PKCS7_SEP) - 1)) != NULL) {
size = strlen(ptr);
ret = parse_pkcs7_cert_mem(cert_list, ncerts, ptr, size, CERT_PEM);
@@ -450,9 +450,11 @@ static int parse_pem_cert_mem(gnutls_cert ** cert_list, uint * ncerts,
/* move to the certificate
*/
- ptr = memstr(input_cert, PEM_CERT_SEP, input_cert_size);
+ ptr = memmem(input_cert, input_cert_size,
+ PEM_CERT_SEP, sizeof (PEM_CERT_SEP) - 1);
if (ptr == NULL)
- ptr = memstr(input_cert, PEM_CERT_SEP2, input_cert_size);
+ ptr = memmem(input_cert, input_cert_size,
+ PEM_CERT_SEP2, sizeof (PEM_CERT_SEP2) - 1);
if (ptr == NULL) {
gnutls_assert();
@@ -502,9 +504,10 @@ static int parse_pem_cert_mem(gnutls_cert ** cert_list, uint * ncerts,
if (size > 0) {
char *ptr2;
- ptr2 = memstr(ptr, PEM_CERT_SEP, size);
+ ptr2 = memmem(ptr, size, PEM_CERT_SEP, sizeof (PEM_CERT_SEP) - 1);
if (ptr2 == NULL)
- ptr2 = memstr(ptr, PEM_CERT_SEP2, size);
+ ptr2 = memmem(ptr, size, PEM_CERT_SEP2,
+ sizeof (PEM_CERT_SEP2) - 1);
ptr = ptr2;
} else
@@ -1123,9 +1126,11 @@ static int parse_pem_ca_mem(gnutls_x509_crt_t ** cert_list, uint * ncerts,
/* move to the certificate
*/
- ptr = memstr(input_cert, PEM_CERT_SEP, input_cert_size);
+ ptr = memmem(input_cert, input_cert_size,
+ PEM_CERT_SEP, sizeof (PEM_CERT_SEP) - 1);
if (ptr == NULL)
- ptr = memstr(input_cert, PEM_CERT_SEP2, input_cert_size);
+ ptr = memmem(input_cert, input_cert_size,
+ PEM_CERT_SEP2, sizeof (PEM_CERT_SEP2) - 1);
if (ptr == NULL) {
gnutls_assert();
@@ -1177,9 +1182,10 @@ static int parse_pem_ca_mem(gnutls_x509_crt_t ** cert_list, uint * ncerts,
if (size > 0) {
char *ptr2;
- ptr2 = memstr(ptr, PEM_CERT_SEP, size);
+ ptr2 = memmem(ptr, size, PEM_CERT_SEP, sizeof (PEM_CERT_SEP) - 1);
if (ptr2 == NULL)
- ptr = memstr(ptr, PEM_CERT_SEP2, size);
+ ptr = memmem(ptr, size,
+ PEM_CERT_SEP2, sizeof (PEM_CERT_SEP2) - 1);
ptr = ptr2;
} else
@@ -1395,7 +1401,8 @@ static int parse_pem_crl_mem(gnutls_x509_crl_t ** crl_list, uint * ncrls,
/* move to the certificate
*/
- ptr = memstr(input_crl, PEM_CRL_SEP, input_crl_size);
+ ptr = memmem(input_crl, input_crl_size,
+ PEM_CRL_SEP, sizeof (PEM_CRL_SEP) -1);
if (ptr == NULL) {
gnutls_assert();
return GNUTLS_E_BASE64_DECODING_ERROR;
@@ -1445,7 +1452,7 @@ static int parse_pem_crl_mem(gnutls_x509_crl_t ** crl_list, uint * ncrls,
size = input_crl_size - (ptr - input_crl);
if (size > 0)
- ptr = memstr(ptr, PEM_CRL_SEP, size);
+ ptr = memmem(ptr, size, PEM_CRL_SEP, sizeof (PEM_CRL_SEP) - 1);
else
ptr = NULL;
i++;