PR: 1972
[openssl.git] / apps / verify.c
index f7c85b8dd66ddded6648f7dcdcf5aea9a6f3d324..20cc9e354cd3c1934d4c4036c1ad68f8fc4e453f 100644 (file)
@@ -266,7 +266,7 @@ static int check(X509_STORE *ctx, char *file, STACK_OF(X509) *uchain, STACK_OF(X
 
        ret=0;
 end:
-       if (i)
+       if (i > 0)
                {
                fprintf(stdout,"OK\n");
                ret=1;
@@ -348,6 +348,7 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
                if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
                /* Continue after extension errors too */
                if (ctx->error == X509_V_ERR_INVALID_CA) ok=1;
+               if (ctx->error == X509_V_ERR_INVALID_NON_CA) ok=1;
                if (ctx->error == X509_V_ERR_PATH_LENGTH_EXCEEDED) ok=1;
                if (ctx->error == X509_V_ERR_INVALID_PURPOSE) ok=1;
                if (ctx->error == X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT) ok=1;
@@ -366,4 +367,3 @@ static int MS_CALLBACK cb(int ok, X509_STORE_CTX *ctx)
                ERR_clear_error();
        return(ok);
        }
-