Skip to content

Commit

Permalink
Audit feedback fixes (v3.0.5) (trilitech#299)
Browse files Browse the repository at this point in the history
* [format] add missing header guard to format.h file

 - plus add missing documentation

* [sign] fix assertion for message type prints
  • Loading branch information
spalmer25 authored Oct 18, 2024
1 parent 667f5de commit 4cd0f96
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/src/apdu_sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ static void
get_blindsign_type(char *type, size_t type_size)
{
TZ_PREAMBLE(("type=%s", type));
TZ_ASSERT(type_size >= OPERATION_TYPE_STR_LENGTH, EXC_MEMORY_ERROR);
TZ_ASSERT(EXC_MEMORY_ERROR, type_size >= OPERATION_TYPE_STR_LENGTH);
// clang-format off
switch (global.keys.apdu.sign.tag) {
case 0x01:
Expand Down
9 changes: 9 additions & 0 deletions app/src/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,17 @@
See the License for the specific language governing permissions and
limitations under the License. */

#pragma once
#include <stdbool.h>
#include <stdint.h>
#include <string.h>

/**
* @brief Prints mutez as XTZ
*
* @param obuf: output buffer
* @param olen: length of the output buffer
* @param amount: amount in mutez
* @return bool: true on success
*/
bool tz_mutez_to_string(char *obuf, size_t olen, uint64_t amount);

0 comments on commit 4cd0f96

Please sign in to comment.