提交 c6ef15c4 编写于 作者: R Richard Levitte

clang on Linux x86_64 complains about unreachable code.

Reviewed-by: NRich Salz <rsalz@openssl.org>
上级 7317192c
......@@ -892,7 +892,6 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass,
i2a_ASN1_OBJECT(bio_err, bag->type);
BIO_printf(bio_err, "\n");
return 1;
break;
}
return 1;
}
......
......@@ -419,7 +419,6 @@ static int parse_tagging(const char *vstart, int vlen, int *ptag, int *pclass)
ASN1err(ASN1_F_PARSE_TAGGING, ASN1_R_INVALID_MODIFIER);
ERR_add_error_data(2, "Char=", erch);
return 0;
break;
}
} else
......@@ -769,7 +768,6 @@ static ASN1_TYPE *asn1_str2type(const char *str, int format, int utype)
default:
ASN1err(ASN1_F_ASN1_STR2TYPE, ASN1_R_UNSUPPORTED_TYPE);
goto bad_str;
break;
}
atmp->type = utype;
......
......@@ -246,7 +246,6 @@ static int asn1_write_micalg(BIO *out, STACK_OF(X509_ALGOR) *mdalgs)
case NID_id_GostR3411_94:
BIO_puts(out, "gostr3411-94");
goto err;
break;
default:
if (have_unknown)
......
......@@ -422,7 +422,6 @@ static long asn1_bio_ctrl(BIO *b, int cmd, long arg1, void *arg2)
BIO_clear_retry_flags(b);
return 0;
}
break;
default:
if (!b->next_bio)
......
......@@ -206,7 +206,6 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
}
return asn1_d2i_ex_primitive(pval, in, len, it,
tag, aclass, opt, ctx);
break;
case ASN1_ITYPE_MSTRING:
p = *in;
......
......@@ -147,7 +147,6 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out,
return asn1_template_ex_i2d(pval, out, it->templates,
tag, aclass);
return asn1_i2d_ex_primitive(pval, out, it, tag, aclass);
break;
case ASN1_ITYPE_MSTRING:
return asn1_i2d_ex_primitive(pval, out, it, -1, aclass);
......@@ -608,7 +607,6 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
case V_ASN1_BIT_STRING:
return i2c_ASN1_BIT_STRING((ASN1_BIT_STRING *)*pval,
cout ? &cout : NULL);
break;
case V_ASN1_INTEGER:
case V_ASN1_NEG_INTEGER:
......@@ -618,7 +616,6 @@ int asn1_ex_i2c(ASN1_VALUE **pval, unsigned char *cout, int *putype,
* These are all have the same content format as ASN1_INTEGER
*/
return i2c_ASN1_INTEGER((ASN1_INTEGER *)*pval, cout ? &cout : NULL);
break;
case V_ASN1_OCTET_STRING:
case V_ASN1_NUMERICSTRING:
......
......@@ -294,7 +294,6 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", ret);
# endif
EXIT(ret);
return (0);
}
static int print_test_data(void)
......
......@@ -686,7 +686,6 @@ static long dgram_ctrl(BIO *b, int cmd, long num, void *ptr)
break;
case BIO_CTRL_DGRAM_GET_MTU:
return data->mtu;
break;
case BIO_CTRL_DGRAM_SET_MTU:
data->mtu = num;
ret = num;
......
......@@ -353,7 +353,6 @@ int main(int argc, char *argv[])
ERR_load_crypto_strings();
ERR_print_errors_fp(stderr);
EXIT(1);
return (1);
}
int test_add(BIO *bp)
......
......@@ -254,5 +254,4 @@ int main(int argc, char *argv[])
printf("ERROR\n");
#endif
EXIT(1);
return (1);
}
......@@ -236,6 +236,5 @@ int main(int argc, char *argv[])
# endif
EXIT(err);
return (err);
}
#endif
......@@ -832,11 +832,9 @@ int CMS_RecipientInfo_encrypt(CMS_ContentInfo *cms, CMS_RecipientInfo *ri)
case CMS_RECIPINFO_KEK:
return cms_RecipientInfo_kekri_encrypt(cms, ri);
break;
case CMS_RECIPINFO_PASS:
return cms_RecipientInfo_pwri_crypt(cms, ri, 1);
break;
default:
CMSerr(CMS_F_CMS_RECIPIENTINFO_ENCRYPT,
......
......@@ -211,7 +211,6 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", ret);
# endif
EXIT(ret);
return (ret);
}
static int cb(int p, int n, BN_GENCB *arg)
......
......@@ -228,7 +228,6 @@ int main(int argc, char **argv)
printf("ERROR\n");
# endif
EXIT(!ret);
return (0);
}
static int dsa_cb(int p, int n, BN_GENCB *arg)
......
......@@ -543,7 +543,6 @@ int main(int argc, char *argv[])
ERR_remove_thread_state(NULL);
CRYPTO_mem_leaks_fp(stderr);
EXIT(ret);
return (ret);
}
# if 0
......
......@@ -227,7 +227,6 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
default:
return 0;
break;
}
}
......
......@@ -152,13 +152,11 @@ PKCS8_PRIV_KEY_INFO *PKCS8_set_broken(PKCS8_PRIV_KEY_INFO *p8, int broken)
case PKCS8_OK:
p8->broken = PKCS8_OK;
return p8;
break;
case PKCS8_NO_OCTET:
p8->broken = PKCS8_NO_OCTET;
p8->pkey->type = V_ASN1_SEQUENCE;
return p8;
break;
default:
EVPerr(EVP_F_PKCS8_SET_BROKEN, EVP_R_PKCS8_UNKNOWN_BROKEN_TYPE);
......
......@@ -126,7 +126,6 @@ static unsigned char *ustrsep(char **p, const char *sep)
static int test1_exit(int ec)
{
EXIT(ec);
return (0); /* To keep some compilers quiet */
}
/* Test copying of contexts */
......
......@@ -150,7 +150,6 @@ int main(int argc, char *argv[])
}
# endif /* OPENSSL_NO_MD5 */
EXIT(err);
return (0);
}
# ifndef OPENSSL_NO_MD5
......
......@@ -173,7 +173,6 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", err);
# endif
EXIT(err);
return (err);
}
static int cfb64_test(unsigned char *cfb_cipher)
......
......@@ -118,7 +118,6 @@ int main(int argc, char *argv[])
P++;
}
EXIT(err);
return (0);
}
static char *pt(unsigned char *md)
......
......@@ -123,7 +123,6 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", err);
# endif
EXIT(err);
return (0);
}
static char *pt(unsigned char *md)
......
......@@ -141,6 +141,5 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", ret);
# endif
EXIT(ret);
return (ret);
}
#endif
......@@ -508,8 +508,6 @@ int OCSP_REQ_CTX_nbio(OCSP_REQ_CTX *rctx)
rctx->state = OHS_DONE;
return 1;
break;
case OHS_DONE:
return 1;
......
......@@ -287,11 +287,9 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen,
case NID_safeContentsBag:
return parse_bags(bag->value.safes, pass, passlen, pkey, ocerts);
break;
default:
return 1;
break;
}
return 1;
}
......@@ -195,5 +195,4 @@ int main(int argc, char **argv)
printf("ERROR: %d\n", err);
#endif
EXIT(err);
return (err);
}
......@@ -147,7 +147,6 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", err);
# endif
EXIT(err);
return (err);
}
#endif
......@@ -230,6 +230,5 @@ int main(int argc, char *argv[])
printf("ERROR: %d\n", err);
# endif
EXIT(err);
return (0);
}
#endif
......@@ -128,7 +128,6 @@ int main(int argc, char *argv[])
P++;
}
EXIT(err);
return (0);
}
static char *pt(unsigned char *md)
......
......@@ -530,7 +530,7 @@ static int tree_prune(X509_POLICY_TREE *tree, X509_POLICY_LEVEL *curr)
}
}
return 1;
/* Unreachable */
}
......
......@@ -189,7 +189,6 @@ BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey)
if (!dsa->priv_key)
return NULL;
return dsa->priv_key;
break;
}
case NID_id_GostR3410_2001:
{
......@@ -201,7 +200,6 @@ BIGNUM *gost_get0_priv_key(const EVP_PKEY *pkey)
if (!(priv = EC_KEY_get0_private_key(ec)))
return NULL;
return (BIGNUM *)priv;
break;
}
}
return NULL;
......
......@@ -86,7 +86,6 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
pctx->md = (EVP_MD *)p2;
return 1;
}
break;
case EVP_PKEY_CTRL_GET_MD:
*(const EVP_MD **)p2 = pctx->md;
......@@ -150,7 +149,6 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx,
break;
default:
return 0;
break;
}
} else if ((strlen(value) == 2)
&& (toupper((unsigned char)value[0]) == 'X')) {
......@@ -166,7 +164,6 @@ static int pkey_gost_ctrl94_str(EVP_PKEY_CTX *ctx,
break;
default:
return 0;
break;
}
} else {
R3410_params *p = R3410_paramset;
......@@ -214,7 +211,6 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx,
break;
default:
return 0;
break;
}
} else if ((strlen(value) == 2)
&& (toupper((unsigned char)value[0]) == 'X')) {
......@@ -227,7 +223,6 @@ static int pkey_gost_ctrl01_str(EVP_PKEY_CTX *ctx,
break;
default:
return 0;
break;
}
} else {
R3410_2001_params *p = R3410_2001_paramset;
......@@ -454,7 +449,6 @@ static int pkey_gost_mac_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2)
data->md = (EVP_MD *)p2;
return 1;
}
break;
case EVP_PKEY_CTRL_GET_MD:
*(const EVP_MD **)p2 = data->md;
......
......@@ -3434,7 +3434,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (ret);
}
break;
#endif
#ifndef OPENSSL_NO_DH
case SSL_CTRL_SET_TMP_DH:
......@@ -3471,7 +3470,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (ret);
}
break;
case SSL_CTRL_SET_DH_AUTO:
s->cert->dh_tmp_auto = larg;
return 1;
......@@ -3508,7 +3506,6 @@ long ssl3_ctrl(SSL *s, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (ret);
}
break;
#endif /* !OPENSSL_NO_ECDH */
#ifndef OPENSSL_NO_TLSEXT
case SSL_CTRL_SET_TLSEXT_HOSTNAME:
......@@ -3927,7 +3924,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (0);
}
break;
#endif
#ifndef OPENSSL_NO_DH
case SSL_CTRL_SET_TMP_DH:
......@@ -3964,7 +3960,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (0);
}
break;
case SSL_CTRL_SET_DH_AUTO:
ctx->cert->dh_tmp_auto = larg;
return 1;
......@@ -4003,7 +3998,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
SSLerr(SSL_F_SSL3_CTX_CTRL, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED);
return (0);
}
break;
#endif /* !OPENSSL_NO_ECDH */
#ifndef OPENSSL_NO_TLSEXT
case SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG:
......@@ -4034,7 +4028,6 @@ long ssl3_ctx_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg)
case SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG:
ctx->tlsext_status_arg = parg;
return 1;
break;
# ifndef OPENSSL_NO_SRP
case SSL_CTRL_SET_TLS_EXT_SRP_USERNAME:
......
......@@ -798,7 +798,7 @@ static int serverinfo_find_extension(const unsigned char *serverinfo,
serverinfo += len;
serverinfo_length -= len;
}
return 0; /* Error */
/* Unreachable */
}
static int serverinfo_srv_parse_cb(SSL *s, unsigned int ext_type,
......
......@@ -1771,7 +1771,6 @@ int main(int argc, char *argv[])
if (bio_err != NULL)
BIO_free(bio_err);
EXIT(ret);
return ret;
}
int doit_biopair(SSL *s_ssl, SSL *c_ssl, long count,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册