summaryrefslogtreecommitdiff
path: root/lib/x509/x509_ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/x509/x509_ext.c')
-rw-r--r--lib/x509/x509_ext.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/lib/x509/x509_ext.c b/lib/x509/x509_ext.c
index aa09ef85f1..6aeb159dba 100644
--- a/lib/x509/x509_ext.c
+++ b/lib/x509/x509_ext.c
@@ -236,8 +236,7 @@ int gnutls_x509_ext_import_subject_alt_names(const gnutls_datum_t * ext,
goto cleanup;
}
- i = 0;
- do {
+ for (i=0;;i++) {
san.data = NULL;
san.size = 0;
othername_oid.data = NULL;
@@ -264,9 +263,7 @@ int gnutls_x509_ext_import_subject_alt_names(const gnutls_datum_t * ext,
(char *)othername_oid.data, 1);
if (ret < 0)
break;
-
- i++;
- } while (ret >= 0);
+ }
sans->size = i;
if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
@@ -916,8 +913,7 @@ int gnutls_x509_ext_import_authority_key_id(const gnutls_datum_t * ext,
}
/* Read authorityCertIssuer */
- i = 0;
- do {
+ for (i=0;;i++) {
san.data = NULL;
san.size = 0;
othername_oid.data = NULL;
@@ -944,9 +940,7 @@ int gnutls_x509_ext_import_authority_key_id(const gnutls_datum_t * ext,
(char *)othername_oid.data, 1);
if (ret < 0)
break;
-
- i++;
- } while (ret >= 0);
+ }
aki->cert_issuer.size = i;
if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE
@@ -2444,8 +2438,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext,
snprintf(name, sizeof(name),
"?%u.distributionPoint.fullName", (unsigned)i + 1);
- j = 0;
- do {
+ for (j=0;;j++) {
san.data = NULL;
san.size = 0;
@@ -2464,9 +2457,7 @@ int gnutls_x509_ext_import_crl_dist_points(const gnutls_datum_t * ext,
if (ret < 0)
break;
san.data = NULL; /* it is now in cdp */
-
- j++;
- } while (ret >= 0);
+ }
i++;
} while (ret >= 0);