Set version number correctly.
[openssl.git] / crypto / cms / cms_sd.c
index e8b2e1f..ac5103a 100644 (file)
@@ -159,8 +159,8 @@ static void cms_sd_set_version(CMS_SignedData *sd)
                        if (sd->version < 3)
                                sd->version = 3;
                        }
-               else
-                       sd->version = 1;
+               else if (si->version < 1)
+                       si->version = 1;
                }
 
        if (sd->version < 1)