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

[crypto] Fix compile error in BufferWriter init #25015

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

tima-q
Copy link
Contributor

@tima-q tima-q commented Feb 13, 2023

Issue:
In CHIPCryptoPALPSA.cpp

BufferWriter class expects a (uint8_t*, size_t) as initialization. The given parameter output was a P256SerializedKeypair which throws a compiler error.

Output: used compiler - gcc-arm-none-eabi-9-2019-q4-major

In member function 'virtual CHIP_ERROR chip::Crypto::P256Keypair::Serialize(chip::Crypto::P256SerializedKeypair&) const': .../src/crypto/CHIPCryptoPALPSA.cpp:685:51: 
error: no matching function for call to 'chip::Encoding::BufferWriter::BufferWriter(chip::Crypto::P256SerializedKeypair&, const size_t&)'
  685 |     Encoding::BufferWriter bbuf(output, outputSize);

Fix:
Use the Bytes method to expose a uint8_t* for use of the BufferWriter.

BufferWriter class expects a (uint8_t*, size_t) as initialization.
The given parameter 'output' was a `P256SerializedKeypair` which throws a compiler error.

Output: used compiler - gcc-arm-none-eabi-9-2019-q4-major
In member function 'virtual CHIP_ERROR chip::Crypto::P256Keypair::Serialize(chip::Crypto::P256SerializedKeypair&) const':
.../src/crypto/CHIPCryptoPALPSA.cpp:685:51: error: no matching function for call to 'chip::Encoding::BufferWriter::BufferWriter(chip::Crypto::P256SerializedKeypair&, const size_t&)'
  685 |     Encoding::BufferWriter bbuf(output, outputSize);

Fix:
Use the `Bytes` method to expose a uint8_t* for use of the BufferWriter.
@github-actions
Copy link

PR #25015: Size comparison from bbfd5d6 to c30660f

Full report (2 builds for cc32xx, mbed)
platform target config section bbfd5d6 c30660f change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 640233 640233 0 0.0
(read/write) 204084 204084 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197488 197488 0 0.0
.comment 194 194 0 0.0
.data 1476 1476 0 0.0
.debug_abbrev 928439 928439 0 0.0
.debug_aranges 87352 87352 0 0.0
.debug_frame 299840 299840 0 0.0
.debug_info 20194444 20194444 0 0.0
.debug_line 2649825 2649825 0 0.0
.debug_loc 2785969 2785969 0 0.0
.debug_ranges 280696 280696 0 0.0
.debug_str 3001474 3001474 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105585 105585 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 375840 375840 0 0.0
.symtab 255856 255856 0 0.0
.text 532524 532524 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2464576 2464576 0 0.0
.bss 215892 215892 0 0.0
.data 5880 5880 0 0.0
.text 1427220 1427220 0 0.0

@Damian-Nordic Damian-Nordic merged commit 36d2d4d into master Feb 13, 2023
@Damian-Nordic Damian-Nordic deleted the crypto/buffer_writer_init branch February 13, 2023 14:18
lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
BufferWriter class expects a (uint8_t*, size_t) as initialization.
The given parameter 'output' was a `P256SerializedKeypair` which throws a compiler error.

Output: used compiler - gcc-arm-none-eabi-9-2019-q4-major
In member function 'virtual CHIP_ERROR chip::Crypto::P256Keypair::Serialize(chip::Crypto::P256SerializedKeypair&) const':
.../src/crypto/CHIPCryptoPALPSA.cpp:685:51: error: no matching function for call to 'chip::Encoding::BufferWriter::BufferWriter(chip::Crypto::P256SerializedKeypair&, const size_t&)'
  685 |     Encoding::BufferWriter bbuf(output, outputSize);

Fix:
Use the `Bytes` method to expose a uint8_t* for use of the BufferWriter.
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.

3 participants