Old typo...
[openssl.git] / crypto / x509 / x509_vfy.c
index 4a30827c83060fb8cd82e8f7ba7d2ce5017bce6b..79dae3d3bf23702b009864bf9d37f03a95eba9e5 100644 (file)
@@ -102,7 +102,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx)
        X509_VERIFY_PARAM *param = ctx->param;
        int depth,i,ok=0;
        int num;
-       int (*cb)(int ok,X509_STORE_CTX *ctx);
+       int (*cb)(int xok,X509_STORE_CTX *xctx);
        STACK_OF(X509) *sktmp=NULL;
        if (ctx->cert == NULL)
                {
@@ -388,7 +388,7 @@ static int check_chain_extensions(X509_STORE_CTX *ctx)
 #else
        int i, ok=0, must_be_ca;
        X509 *x;
-       int (*cb)(int ok,X509_STORE_CTX *ctx);
+       int (*cb)(int xok,X509_STORE_CTX *xctx);
        int proxy_path_length = 0;
        int allow_proxy_certs =
                !!(ctx->param->flags & X509_V_FLAG_ALLOW_PROXY_CERTS);
@@ -531,7 +531,7 @@ static int check_trust(X509_STORE_CTX *ctx)
 #else
        int i, ok;
        X509 *x;
-       int (*cb)(int ok,X509_STORE_CTX *ctx);
+       int (*cb)(int xok,X509_STORE_CTX *xctx);
        cb=ctx->verify_cb;
 /* For now just check the last certificate in the chain */
        i = sk_X509_num(ctx->chain) - 1;
@@ -776,7 +776,8 @@ static int check_crl(X509_STORE_CTX *ctx, X509_CRL *crl)
                        }
                }
 
-       if (!check_crl_time(ctx, crl, 1))
+       ok = check_crl_time(ctx, crl, 1);
+       if (!ok)
                goto err;
 
        ok = 1;
@@ -849,7 +850,7 @@ static int check_policy(X509_STORE_CTX *ctx)
                                ctx->param->policies, ctx->param->flags);
        if (ret == 0)
                {
-               X509err(X509_F_X509_VERIFY_CERT,ERR_R_MALLOC_FAILURE);
+               X509err(X509_F_CHECK_POLICY,ERR_R_MALLOC_FAILURE);
                return 0;
                }
        /* Invalid or inconsistent extensions */
@@ -941,7 +942,7 @@ static int internal_verify(X509_STORE_CTX *ctx)
        int ok=0,n;
        X509 *xs,*xi;
        EVP_PKEY *pkey=NULL;
-       int (*cb)(int ok,X509_STORE_CTX *ctx);
+       int (*cb)(int xok,X509_STORE_CTX *xctx);
 
        cb=ctx->verify_cb;
 
@@ -1006,7 +1007,8 @@ static int internal_verify(X509_STORE_CTX *ctx)
 
                xs->valid = 1;
 
-               if (!check_cert_time(ctx, xs))
+               ok = check_cert_time(ctx, xs);
+               if (!ok)
                        goto end;
 
                /* The last error (if any) is still in the error value */
@@ -1079,7 +1081,7 @@ int X509_cmp_time(ASN1_TIME *ctm, time_t *cmp_time)
                offset=0;
        else
                {
-               if ((*str != '+') && (str[5] != '-'))
+               if ((*str != '+') && (*str != '-'))
                        return 0;
                offset=((str[1]-'0')*10+(str[2]-'0'))*60;
                offset+=(str[3]-'0')*10+(str[4]-'0');