Fix regression in i2d_re_X509_REQ_tbs()
authorTomas Mraz <tomas@openssl.org>
Thu, 29 Sep 2022 11:00:45 +0000 (13:00 +0200)
committerTomas Mraz <tomas@openssl.org>
Wed, 5 Oct 2022 14:12:38 +0000 (16:12 +0200)
This fixes regression from commit 8e39049. There is also no point
in setting the modified flag after just calling i2d.

Fixes #19297

Reviewed-by: Hugo Landau <hlandau@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19299)

crypto/x509/x509_req.c

index 2a7836c23e352474b028a4ff85c41702ac6b6d83..fa73b331a5ae3eb229d64e2c695cc1026dcd7ae4 100644 (file)
@@ -309,8 +309,6 @@ int i2d_re_X509_REQ_tbs(X509_REQ *req, unsigned char **pp)
         ERR_raise(ERR_LIB_X509, ERR_R_PASSED_NULL_PARAMETER);
         return 0;
     }
-    if (!i2d_X509_REQ_INFO(&req->req_info, pp))
-        return 0;
     req->req_info.enc.modified = 1;
-    return 1;
+    return i2d_X509_REQ_INFO(&req->req_info, pp);
 }