Skip to content

20240104-with-liboqs-clang-tidy#7114

Merged
dgarske merged 1 commit intowolfSSL:masterfrom
douzzer:20240104-with-liboqs-clang-tidy
Jan 5, 2024
Merged

20240104-with-liboqs-clang-tidy#7114
dgarske merged 1 commit intowolfSSL:masterfrom
douzzer:20240104-with-liboqs-clang-tidy

Conversation

@douzzer
Copy link
Copy Markdown
Contributor

@douzzer douzzer commented Jan 4, 2024

fixes for clang-tidy reported defects and misstylings --with-liboqs:

  • readability-named-parameter (style)
  • bugprone-sizeof-expression (true bugs)
  • clang-analyzer-deadcode.DeadStores (true bugs)
  • clang-analyzer-core.NonNullParamChecker (true bug)
  • clang-diagnostic-newline-eof (style)
  • clang-diagnostic-shorten-64-to-32 (true but benign in practice)

fixes for sanitizer reported defects --with-liboqs: null pointer memcpy()s in TLSX_KeyShare_GenPqcKey() and server_generate_pqc_ciphertext().

fixes for silent crypto-critical failure in wolfSSL_liboqsGetRandomData(): refactor to accommodate oversize numOfBytes, and abort() if wc_RNG_GenerateBlock() returns failure.

tested with wolfssl-multi-test.sh ... check-self check-file-modes check-source-text check-shell-scripts check-configure all-gcc-c99 pq-all pq-all-clang-tidy pq-all-sanitizer pq-all-cppcheck

(pq-all-clang-tidy pq-all-sanitizer pq-all-cppcheck are new tests)

supersedes fix in #7111 which itself fixed #7108 .

* readability-named-parameter (style)
* bugprone-sizeof-expression (true bugs)
* clang-analyzer-deadcode.DeadStores (true bugs)
* clang-analyzer-core.NonNullParamChecker (true bug)
* clang-diagnostic-newline-eof (style)
* clang-diagnostic-shorten-64-to-32 (true but benign in practice)

fixes for sanitizer reported defects --with-liboqs: null pointer memcpy()s in TLSX_KeyShare_GenPqcKey() and server_generate_pqc_ciphertext().

fixes for silent crypto-critical failure in wolfSSL_liboqsGetRandomData(): refactor to accommodate oversize numOfBytes, and abort() if wc_RNG_GenerateBlock() returns failure.
@douzzer douzzer requested a review from anhu January 4, 2024 22:04
@douzzer
Copy link
Copy Markdown
Contributor Author

douzzer commented Jan 4, 2024

retest this please.

@douzzer
Copy link
Copy Markdown
Contributor Author

douzzer commented Jan 5, 2024

retest this please.

Comment thread wolfcrypt/src/port/liboqs/liboqs.c
@douzzer douzzer requested a review from SparkiDev January 5, 2024 05:32
Comment thread wolfcrypt/src/sphincs.c
Comment thread wolfcrypt/src/sphincs.c
Comment thread wolfcrypt/src/port/liboqs/liboqs.c
@anhu anhu self-requested a review January 5, 2024 17:00
@douzzer douzzer removed the request for review from SparkiDev January 5, 2024 17:12
@dgarske dgarske dismissed SparkiDev’s stale review January 5, 2024 17:17

Not going to do retry now. Just solving the case where no data was written and silently failed

@dgarske dgarske merged commit 8026aa4 into wolfSSL:master Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: liboqs build fails with clang

4 participants