[openssl] master update

dev at ddvo.net dev at ddvo.net
Wed Mar 18 12:45:03 UTC 2020


The branch master has been updated
       via  90a7c90500ddb3c29eff988a8840ffc1e3e44e7a (commit)
       via  aed723f1e402d286f1f655e5fd93b9ff8a55452f (commit)
       via  38e497818e8775f16cfff12ca3226acbd2f30471 (commit)
      from  cde63b731575e6be41b3f94bcd9fa941cdc45488 (commit)


- Log -----------------------------------------------------------------
commit 90a7c90500ddb3c29eff988a8840ffc1e3e44e7a
Author: Dr. David von Oheimb <David.von.Oheimb at siemens.com>
Date:   Tue Mar 10 08:12:57 2020 +0100

    fix false positive of check-format.pl regarding '#if' on preceding line; extend negative tests
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/11285)

commit aed723f1e402d286f1f655e5fd93b9ff8a55452f
Author: Dr. David von Oheimb <David.von.Oheimb at siemens.com>
Date:   Mon Mar 9 14:48:14 2020 +0100

    make util/check-format.pl script executable
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/11285)

commit 38e497818e8775f16cfff12ca3226acbd2f30471
Author: Dr. David von Oheimb <David.von.Oheimb at siemens.com>
Date:   Mon Mar 9 14:42:40 2020 +0100

    fix false positive of check-format.pl reporting '{1 stmt}' after multi-line 'if(expr)'
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: David von Oheimb <david.von.oheimb at siemens.com>
    (Merged from https://github.com/openssl/openssl/pull/11285)

-----------------------------------------------------------------------

Summary of changes:
 util/check-format-test-negatives.c | 39 ++++++++++++++++++++++++++++++++++++++
 util/check-format.pl               |  5 +++--
 2 files changed, 42 insertions(+), 2 deletions(-)
 mode change 100644 => 100755 util/check-format.pl

diff --git a/util/check-format-test-negatives.c b/util/check-format-test-negatives.c
index c9f781e06b..35cbd75ba3 100644
--- a/util/check-format-test-negatives.c
+++ b/util/check-format-test-negatives.c
@@ -113,7 +113,46 @@ int f(void) /*
         5;
     else
         6;
+
+    if (1) {
+        if (2) {
+        case MAC_TYPE_MAC:
+            {
+                EVP_MAC_CTX *new_mac_ctx;
+
+                if (ctx->pkey == NULL)
+                    return 0;
+            }
+            break;
+        default:
+            /* This should be dead code */
+            return 0;
+        }
+    }
+    if (expr_line1
+        == expr_line2
+            && expr_line3) {
+        c1;
+    } else {
+        c;
+        d;
+    }
+    if (expr_line1
+        == expr_line2
+            && expr_line3)
+        hanging_stmt;
 }
+
+const OPTIONS passwd_options[] = {
+    {"aixmd5", OPT_AIXMD5, '-', "AIX MD5-based password algorithm"},
+#if !defined(OPENSSL_NO_DES) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+    {"crypt", OPT_CRYPT, '-', "Standard Unix password algorithm (default)"},
+#endif
+    OPT_R_OPTIONS,
+
+    {NULL}
+};
+
 typedef * d(int)
     x;
 typedef (int)
diff --git a/util/check-format.pl b/util/check-format.pl
old mode 100644
new mode 100755
index af77d20920..b7c28f15ef
--- a/util/check-format.pl
+++ b/util/check-format.pl
@@ -868,7 +868,8 @@ while (<>) { # loop over all lines of all input files
     if ($paren_expr_start || $return_enum_start || $assignment_start)
     {
         my ($head, $mid, $tail) = ($1, $3, $4);
-        $keyword_opening_brace = $mid if $mid ne "=" && $tail =~ m/\{/;
+        $keyword_opening_brace = $mid if $mid ne "=";
+        # to cope with multi-line expressions, do this also if !($tail =~ m/\{/)
         push @in_if_hanging_offsets, $hanging_offset if $mid eq "if";
 
         # already handle $head, i.e., anything before expression
@@ -1000,7 +1001,7 @@ while (<>) { # loop over all lines of all input files
     # check for opening brace after if/while/for/switch/do not on same line
     # note that "no '{' on same line after '} else'" is handled further below
     if (/^[\s@]*{/ && # leading '{'
-        $line_before > 0 &&
+        $line_before > 0 && !($contents_before_ =~ m/^\s*#/) && # not preprocessor directive '#if
         (my ($head, $mid, $tail) = ($contents_before_ =~ m/(^|^.*\W)(if|while|for|switch|do)(\W.*$|$)/))) {
         my $brace_after  = $tail =~ /^[\s@]*{/; # any whitespace or comments then '{'
         report("'{' not on same line as preceding '$mid'") if !$brace_after;


More information about the openssl-commits mailing list