x509_vfy.c: Remove superfluous assignment to 'ret' in check_chain()
authorAnkita Shetty <ankita.s.shetty65@gmail.com>
Fri, 20 Nov 2020 09:15:35 +0000 (10:15 +0100)
committerPauli <paul.dale@oracle.com>
Sun, 22 Nov 2020 05:45:14 +0000 (15:45 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13458)

crypto/x509/x509_vfy.c

index 1ee688f3b8183bb00fd1206462127da3845fcfca..d73e078cfe2aa9b63b2253ddcefbf5aff2f8d351 100644 (file)
@@ -484,11 +484,9 @@ static int check_chain(X509_STORE_CTX *ctx)
             CHECK_CB((ctx->param->flags & X509_V_FLAG_X509_STRICT) != 0
                          && ret != 1 && ret != 0,
                      ctx, x, i, X509_V_ERR_INVALID_CA);
-            ret = 1;
             break;
         case 0:
-            CHECK_CB(ret != 0,  ctx, x, i, X509_V_ERR_INVALID_NON_CA);
-            ret = 1;
+            CHECK_CB(ret != 0, ctx, x, i, X509_V_ERR_INVALID_NON_CA);
             break;
         default:
             /* X509_V_FLAG_X509_STRICT is implicit for intermediate CAs */
@@ -496,7 +494,6 @@ static int check_chain(X509_STORE_CTX *ctx)
                      || ((i + 1 < num
                           || ctx->param->flags & X509_V_FLAG_X509_STRICT)
                          && ret != 1), ctx, x, i, X509_V_ERR_INVALID_CA);
-            ret = 1;
             break;
         }
         if (num > 1) {