[openssl-dev] [1.0.1m] strange behavior of make stacks

Annie a.yousar at informatik.hu-berlin.de
Tue Apr 14 18:44:49 UTC 2015


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
 }


More information about the openssl-dev mailing list