GH1141: Different fix, preferred by Richard.
[openssl.git] / 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;
         }
     }
             env->version = 2;
         }
     }
-    if (env->version == 2)
-        return;
     if (env->originatorInfo || env->unprotectedAttrs)
         env->version = 2;
     if (env->originatorInfo || env->unprotectedAttrs)
         env->version = 2;
+    if (env->version == 2)
+        return;
     env->version = 0;
 }
 
     env->version = 0;
 }