Skip to content

Commit

Permalink
[silicon_creator] Remove cbor dependency on log
Browse files Browse the repository at this point in the history
This dependency is only used to log an error message which is
already covered by a specific error code anyway. Also since `log`
only compiles on OT, it prevents the unittests from being runnable
on host.

Signed-off-by: Amaury Pouly <[email protected]>
  • Loading branch information
pamaury committed Feb 4, 2025
1 parent 4a3bcec commit 6e0610d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion sw/device/silicon_creator/lib/cert/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ cc_library(
hdrs = ["cbor.h"],
deps = [
"//sw/device/lib/base:status",
"//sw/device/lib/runtime:log",
"@open-dice//:cbor_reader_writer",
],
)
Expand Down
12 changes: 5 additions & 7 deletions sw/device/silicon_creator/lib/cert/cbor.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,13 @@
#define OPENTITAN_SW_DEVICE_SILICON_CREATOR_LIB_CERT_CBOR_H_

#include "include/dice/cbor_writer.h"
#include "sw/device/lib/runtime/log.h"
#include "sw/device/silicon_creator/lib/error.h"

#define CBOR_RETURN_IF_OVERFLOWED(p) \
do { \
if (CborOutOverflowed(p)) { \
LOG_ERROR("CborOutOverflowed!!"); \
return kErrorCertInvalidSize; \
} \
#define CBOR_RETURN_IF_OVERFLOWED(p) \
do { \
if (CborOutOverflowed(p)) { \
return kErrorCertInvalidSize; \
} \
} while (0)

#define CBOR_CHECK_OVERFLOWED_AND_RETURN(p) \
Expand Down

0 comments on commit 6e0610d

Please sign in to comment.