GH1141: Different fix, preferred by Richard.
authorRich Salz <rsalz@openssl.org>
Mon, 13 Jun 2016 13:51:12 +0000 (09:51 -0400)
committerRich Salz <rsalz@openssl.org>
Mon, 13 Jun 2016 22:36:35 +0000 (18:36 -0400)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/cms/cms_env.c

index 111b2aa5735fcaecf0c91f8349dd71703306118a..b143a91f243167b437077bd31bebeae0ccf86ccf 100644 (file)
@@ -833,10 +833,10 @@ static void cms_env_set_version(CMS_EnvelopedData *env)
             env->version = 2;
         }
     }
-    if (env->version == 2)
-        return;
     if (env->originatorInfo || env->unprotectedAttrs)
         env->version = 2;
+    if (env->version == 2)
+        return;
     env->version = 0;
 }