Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of nullptr for 0 length plaintext/ciphertext in crypto #10198

Merged
merged 2 commits into from
Oct 4, 2021

Conversation

pan-apple
Copy link
Contributor

Problem

Change overview

OpenSSL APIs do not support using nullptr for 0 length plaintext for encrypt, and 0 length cipher-text for decrypt operations. Expectation is to use an empty string instead of nullptr.

This PR uses a temporary empty string if the user has provided a nullptr and 0 length for the corresponding value. It also adds more checks and tests to ensure that API behaves as expected.

Testing

Added more unit tests to CHIPCryptoPALTest suite.

@github-actions
Copy link

github-actions bot commented Oct 4, 2021

Size increase report for "gn_qpg-example-build" from ed8d28c

File Section File VM
chip-qpg6100-lighting-example.out .text 24 24
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-qpg6100-lighting-example.out.map and ./pull_artifact/chip-qpg6100-lighting-example.out.map:

BLOAT EXECUTION FAILED WITH CODE 1:
bloaty: unknown file type for file './pull_artifact/chip-qpg6100-lighting-example.out.map'

Comparing ./master_artifact/chip-qpg6100-lighting-example.out and ./pull_artifact/chip-qpg6100-lighting-example.out:

sections,vmsize,filesize
.debug_line,0,29
.text,24,24
.debug_info,0,2
.debug_str,0,1
[Unmapped],0,-24


src/crypto/CHIPCryptoPALOpenSSL.cpp Outdated Show resolved Hide resolved
src/crypto/CHIPCryptoPALmbedTLS.cpp Outdated Show resolved Hide resolved
@github-actions
Copy link

github-actions bot commented Oct 4, 2021

Size increase report for "nrfconnect-example-build" from ed8d28c

File Section File VM
chip-shell.elf text 24 24
chip-shell.elf device_handles -8 -8
chip-lock.elf text 24 24
chip-lock.elf device_handles -8 -8
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-shell.elf and ./pull_artifact/chip-shell.elf:

sections,vmsize,filesize
.debug_line,0,26
text,24,24
.debug_info,0,2
.debug_loc,0,-4
device_handles,-8,-8

Comparing ./master_artifact/chip-lock.elf and ./pull_artifact/chip-lock.elf:

sections,vmsize,filesize
.debug_line,0,30
text,24,24
.debug_info,0,2
device_handles,-8,-8


@github-actions
Copy link

github-actions bot commented Oct 4, 2021

Size increase report for "esp32-example-build" from ed8d28c

File Section File VM
chip-all-clusters-app.elf .flash.text 48 48
Full report output
BLOAT REPORT

Files found only in the build output:
    report.csv

Comparing ./master_artifact/chip-all-clusters-app.elf and ./pull_artifact/chip-all-clusters-app.elf:

sections,vmsize,filesize
.debug_line,0,97
.flash.text,48,48
.debug_frame,0,8
.debug_loc,0,4
.riscv.attributes,0,-1
.debug_abbrev,0,-20
.debug_ranges,0,-24
[Unmapped],0,-48


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CASE resumption fails with openssl due to null pointers being used
6 participants