{
int ret;
char tmpstr[128];
- unsigned indx = 0;
+ unsigned indx;
gnutls_datum_t tmp = { NULL, 0 };
unsigned int type;
struct name_constraints_node_st *nc, *prev;
prev = prev->next;
}
- do {
- indx++;
+ for (indx=1;;indx++) {
snprintf(tmpstr, sizeof(tmpstr), "%s.?%u.base", vstr, indx);
ret =
}
tmp.data = NULL;
- } while (ret >= 0);
+ }
if (ret < 0 && ret != GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE) {
gnutls_assert();
unsigned san_type;
int ret;
- idx = 0;
found_one = 0;
- do {
+ for (idx=0;;idx++) {
name_size = sizeof(name);
ret = gnutls_x509_crt_get_subject_alt_name2(cert,
- idx++, name, &name_size, &san_type, NULL);
+ idx, name, &name_size, &san_type, NULL);
if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
break;
else if (ret < 0)
found_one = 1;
break;
- } while(ret >= 0);
+ }
if (found_one != 0)
return check_unsupported_constraint(nc, type);
return 1; /* shortcut; no constraints to check */
if (type == GNUTLS_SAN_RFC822NAME) {
- idx = found_one = 0;
- do {
+ found_one = 0;
+ for (idx=0;;idx++) {
name_size = sizeof(name);
ret = gnutls_x509_crt_get_subject_alt_name2(cert,
- idx++, name, &name_size, &san_type, NULL);
+ idx, name, &name_size, &san_type, NULL);
if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
break;
else if (ret < 0)
&n);
if (t == 0)
return gnutls_assert_val(t);
- } while(ret >= 0);
+ }
/* there is at least a single e-mail. That means that the EMAIL field will
* not be used for verifying the identity of the holder. */
return gnutls_assert_val(1);
}
} else if (type == GNUTLS_SAN_DNSNAME) {
- idx = found_one = 0;
- do {
+ found_one = 0;
+ for (idx=0;;idx++) {
name_size = sizeof(name);
ret = gnutls_x509_crt_get_subject_alt_name2(cert,
- idx++, name, &name_size, &san_type, NULL);
+ idx, name, &name_size, &san_type, NULL);
if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
break;
else if (ret < 0)
&n);
if (t == 0)
return gnutls_assert_val(t);
- } while(ret >= 0);
+ }
/* there is at least a single DNS name. That means that the CN will
* not be used for verifying the identity of the holder. */
return gnutls_assert_val(1);
}
} else if (type == GNUTLS_SAN_IPADDRESS) {
- idx = found_one = 0;
- do {
+ found_one = 0;
+ for (idx=0;;idx++) {
name_size = sizeof(name);
ret = gnutls_x509_crt_get_subject_alt_name2(cert,
- idx++, name, &name_size, &san_type, NULL);
+ idx, name, &name_size, &san_type, NULL);
if (ret == GNUTLS_E_REQUESTED_DATA_NOT_AVAILABLE)
break;
else if (ret < 0)
t = gnutls_x509_name_constraints_check(nc, GNUTLS_SAN_IPADDRESS, &n);
if (t == 0)
return gnutls_assert_val(t);
- } while(ret >= 0);
+ }
/* there is at least a single IP address. */
goto cleanup;
}
- i = 0;
- do {
+ for (i=0;;i++) {
san.data = NULL;
san.size = 0;
othername_oid.data = NULL;
(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) {
}
/* Read authorityCertIssuer */
- i = 0;
- do {
+ for (i=0;;i++) {
san.data = NULL;
san.size = 0;
othername_oid.data = NULL;
(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
snprintf(name, sizeof(name),
"?%u.distributionPoint.fullName", (unsigned)i + 1);
- j = 0;
- do {
+ for (j=0;;j++) {
san.data = NULL;
san.size = 0;
if (ret < 0)
break;
san.data = NULL; /* it is now in cdp */
-
- j++;
- } while (ret >= 0);
+ }
i++;
} while (ret >= 0);