[openssl-dev] [openssl.org #4034] mkstack.pl does generate new safestack.h until release 1.0.1m

Annie Yousar via RT rt at openssl.org
Thu Sep 10 15:30:18 UTC 2015


Hello Ralf,
I discovered that already in April, and I sent an e-mail to the list on
2015-04-14 20:46:15
For your convienence the e-mail (including a patch proposal) is attached.
Regards,
/Ann.


Am 10.09.2015 um 17:09 schrieb ralf.vennemann at web.de via RT:
> Hello,
> 
> since OpenSSL release 1.0.1m the mkstack.pl script does not generate a new safestack.h file if new DECLARE_STACK_OF macros are available.
> I found the following issues:
> 
> 1. The format of the following comment in safestack.h has changed:
>   Old style (required by mkstack.pl):
>     /* This block of defines is updated by util/mkstack.pl, please do not touch! */
> 
>   New style:
>     /*
>      * This block of defines is updated by util/mkstack.pl, please do not touch!
>      */
> 
> 2. The following line is missing in safestack.h (but required by the mkstack.pl script):
>   /* End of util/mkstack.pl block, you may now edit :-) */
> 
> Regards,
> Ralf
> 
> _______________________________________________
> openssl-bugs-mod mailing list
> openssl-bugs-mod at openssl.org
> https://mta.openssl.org/mailman/listinfo/openssl-bugs-mod
> 
> _______________________________________________
> openssl-dev mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev
> 


-------------- next part --------------
Dear all,
I discovered a very strange behavior after the 1.0.1l to 1.0.1m change.
The "make stacks" aka the Perl script util/mkstack.pl was broken.
But the script itself wasn't changed, you may see that e.g. looking for
tab chars, surviving therein.
The reason is the change in the comment structuring (!) in
crypto/stack/safestack.h.
I was faced with this problem working on an implementation for the
(stack of) qcStatements, a v3 extension according to RFC 3739.

Some explanations:
The script util/mkstacks.pl looks for a line beginning with regex
^/\* This block of defines is updated by util/mkstack.pl, please do not
touch! \*/

But this line doesn't appear anymore in crypto/stack/safestack.h. It is
now transformed into
/ *
  * This block of defines is updated by util/mkstack.pl, please do not
touch!
  */
despite the warning "do not touch". The attached patch solves the issue.

Beside of this crypto/stack/safestack.h lost also the following line at
the very end:
/* End of util/mkstack.pl block, you may now edit :-) */

which is also expected by the util/mkstack.pl script.
I'm not fully aware of the consequences so I propose to give this line
back to safestack.

It is also integrated in the patch.

Regards,
/Ann.

-------------- next part --------------
--- openssl-1.0.1m/util/mkstack.pl	2015-03-19 14:37:10.000000000 +0100
+++ openssl-1.0.1m.patch/util/mkstack.pl	2015-04-14 11:52:06.765625000 +0200
@@ -60,8 +60,8 @@
 	$old_stackfile .= $_;
 
-	if (m|^/\* This block of defines is updated by util/mkstack.pl, please do not touch! \*/|) {
+	if (m|^ \* This block of defines is updated by util/mkstack.pl, please do not touch!|) {
 		$inside_block = 1;
 	}
-	if (m|^/\* End of util/mkstack.pl block, you may now edit :-\) \*/|) {
+	if (m|^ \* End of util/mkstack.pl block, you may now edit :-\)|) {
 		$inside_block = 0;
 	} elsif ($inside_block == 0) {
@@ -69,5 +69,5 @@
 	}
 	next if($inside_block != 1);
-	$new_stackfile .= "/* This block of defines is updated by util/mkstack.pl, please do not touch! */";
+	$new_stackfile .= " * This block of defines is updated by util/mkstack.pl, please do not touch!\n */";
 		
 	foreach $type_thing (sort @stacklst) {
@@ -175,5 +175,5 @@
 	}
 
-	$new_stackfile .= "/* End of util/mkstack.pl block, you may now edit :-) */\n";
+	$new_stackfile .= "/*\n * End of util/mkstack.pl block, you may now edit :-)\n";
 	$inside_block = 2;
 }
--- openssl-1.0.1m/crypto/stack/safestack.h	2015-03-19 14:38:23.000000000 +0100
+++ openssl-1.0.1m.patch/crypto/stack/safestack.h	2015-04-14 11:52:56.468750000 +0200
@@ -2531,4 +2531,8 @@
   LHM_lh_stats_bio(SSL_SESSION,lh,out)
 # define lh_SSL_SESSION_free(lh) LHM_lh_free(SSL_SESSION,lh)
+/*
+ * End of util/mkstack.pl block, you may now edit :-)
+ */
+
 #ifdef  __cplusplus
 }
-------------- next part --------------
_______________________________________________
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev


More information about the openssl-dev mailing list