提交 b5292f7b 编写于 作者: F Flavio Medeiros 提交者: Rich Salz

GH480: Don't break statements with CPP stuff.

This is also RT 4137
Signed-off-by: NRich Salz <rsalz@akamai.com>
Reviewed-by: NAndy Polyakov <appro@openssl.org>
上级 f7c798e3
...@@ -1120,7 +1120,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk, ...@@ -1120,7 +1120,7 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
STACK_OF(CONF_VALUE) *attr_sk, int attribs, STACK_OF(CONF_VALUE) *attr_sk, int attribs,
unsigned long chtype) unsigned long chtype)
{ {
int i; int i, spec_char, plus_char;
char *p, *q; char *p, *q;
char *type; char *type;
CONF_VALUE *v; CONF_VALUE *v;
...@@ -1136,24 +1136,26 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk, ...@@ -1136,24 +1136,26 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk,
/* /*
* Skip past any leading X. X: X, etc to allow for multiple instances * Skip past any leading X. X: X, etc to allow for multiple instances
*/ */
for (p = v->name; *p; p++) for (p = v->name; *p; p++) {
#ifndef CHARSET_EBCDIC #ifndef CHARSET_EBCDIC
if ((*p == ':') || (*p == ',') || (*p == '.')) { spec_char = ((*p == ':') || (*p == ',') || (*p == '.'));
#else #else
if ((*p == os_toascii[':']) || (*p == os_toascii[',']) spec_char = ((*p == os_toascii[':']) || (*p == os_toascii[','])
|| (*p == os_toascii['.'])) { || (*p == os_toascii['.']));
#endif #endif
if (spec_char) {
p++; p++;
if (*p) if (*p)
type = p; type = p;
break; break;
} }
}
#ifndef CHARSET_EBCDIC #ifndef CHARSET_EBCDIC
if (*p == '+') plus_char = (*p == '+');
#else #else
if (*p == os_toascii['+']) plus_char = (*p == os_toascii['+']);
#endif #endif
{ if (plus_char) {
p++; p++;
mval = -1; mval = -1;
} else } else
......
...@@ -1892,8 +1892,7 @@ int s_server_main(int argc, char *argv[]) ...@@ -1892,8 +1892,7 @@ int s_server_main(int argc, char *argv[])
not_resumable_sess_cb); not_resumable_sess_cb);
} }
#ifndef OPENSSL_NO_PSK #ifndef OPENSSL_NO_PSK
if (psk_key != NULL) if (psk_key != NULL) {
{
if (s_debug) if (s_debug)
BIO_printf(bio_s_out, BIO_printf(bio_s_out,
"PSK key given, setting server callback\n"); "PSK key given, setting server callback\n");
......
...@@ -94,7 +94,7 @@ int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type) ...@@ -94,7 +94,7 @@ int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type)
int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
{ {
int i, j, k, m, n, again, bufsize; int i, j, k, m, n, again, bufsize, spec_char;
unsigned char *s = NULL, *sp; unsigned char *s = NULL, *sp;
unsigned char *bufp; unsigned char *bufp;
int num = 0, slen = 0, first = 1; int num = 0, slen = 0, first = 1;
...@@ -122,18 +122,18 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) ...@@ -122,18 +122,18 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size)
for (j = i - 1; j > 0; j--) { for (j = i - 1; j > 0; j--) {
#ifndef CHARSET_EBCDIC #ifndef CHARSET_EBCDIC
if (!(((buf[j] >= '0') && (buf[j] <= '9')) || spec_char = (!(((buf[j] >= '0') && (buf[j] <= '9')) ||
((buf[j] >= 'a') && (buf[j] <= 'f')) || ((buf[j] >= 'a') && (buf[j] <= 'f')) ||
((buf[j] >= 'A') && (buf[j] <= 'F')))) ((buf[j] >= 'A') && (buf[j] <= 'F'))));
#else #else
/* /*
* This #ifdef is not strictly necessary, since the characters * This #ifdef is not strictly necessary, since the characters
* A...F a...f 0...9 are contiguous (yes, even in EBCDIC - but * A...F a...f 0...9 are contiguous (yes, even in EBCDIC - but
* not the whole alphabet). Nevertheless, isxdigit() is faster. * not the whole alphabet). Nevertheless, isxdigit() is faster.
*/ */
if (!isxdigit(buf[j])) spec_char = (!isxdigit(buf[j]));
#endif #endif
{ if (spec_char) {
i = j; i = j;
break; break;
} }
......
...@@ -458,6 +458,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ...@@ -458,6 +458,7 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
int *ip; int *ip;
bio_dgram_data *data = NULL; bio_dgram_data *data = NULL;
int sockopt_val = 0; int sockopt_val = 0;
int d_errno;
# if defined(OPENSSL_SYS_LINUX) && (defined(IP_MTU_DISCOVER) || defined(IP_MTU)) # if defined(OPENSSL_SYS_LINUX) && (defined(IP_MTU_DISCOVER) || defined(IP_MTU))
socklen_t sockopt_len; /* assume that system supporting IP_MTU is socklen_t sockopt_len; /* assume that system supporting IP_MTU is
* modern enough to define socklen_t */ * modern enough to define socklen_t */
...@@ -760,11 +761,11 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr) ...@@ -760,11 +761,11 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
/* fall-through */ /* fall-through */
case BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP: case BIO_CTRL_DGRAM_GET_RECV_TIMER_EXP:
# ifdef OPENSSL_SYS_WINDOWS # ifdef OPENSSL_SYS_WINDOWS
if (data->_errno == WSAETIMEDOUT) d_errno = (data->_errno == WSAETIMEDOUT);
# else # else
if (data->_errno == EAGAIN) d_errno = (data->_errno == EAGAIN);
# endif # endif
{ if (d_errno) {
ret = 1; ret = 1;
data->_errno = 0; data->_errno = 0;
} else } else
......
...@@ -1303,7 +1303,7 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, ...@@ -1303,7 +1303,7 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
unsigned long chtype) unsigned long chtype)
{ {
CONF_VALUE *v; CONF_VALUE *v;
int i, mval; int i, mval, spec_char, plus_char;
char *p, *type; char *p, *type;
if (!nm) if (!nm)
return 0; return 0;
...@@ -1314,25 +1314,26 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk, ...@@ -1314,25 +1314,26 @@ int X509V3_NAME_from_section(X509_NAME *nm, STACK_OF(CONF_VALUE) *dn_sk,
/* /*
* Skip past any leading X. X: X, etc to allow for multiple instances * Skip past any leading X. X: X, etc to allow for multiple instances
*/ */
for (p = type; *p; p++) for (p = type; *p; p++) {
#ifndef CHARSET_EBCDIC #ifndef CHARSET_EBCDIC
if ((*p == ':') || (*p == ',') || (*p == '.')) spec_char = ((*p == ':') || (*p == ',') || (*p == '.'));
#else #else
if ((*p == os_toascii[':']) || (*p == os_toascii[',']) spec_char = ((*p == os_toascii[':']) || (*p == os_toascii[','])
|| (*p == os_toascii['.'])) || (*p == os_toascii['.']));
#endif #endif
{ if (spec_char) {
p++; p++;
if (*p) if (*p)
type = p; type = p;
break; break;
} }
}
#ifndef CHARSET_EBCDIC #ifndef CHARSET_EBCDIC
if (*type == '+') plus_char = (*type == '+');
#else #else
if (*type == os_toascii['+']) plus_char = (*type == os_toascii['+']);
#endif #endif
{ if (plus_char) {
mval = -1; mval = -1;
type++; type++;
} else } else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册