From 06edff206cedfb3a80c8f4f8bcd6252e72c3d0e7f018910db37fb12b07a748af Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Fri, 10 Jan 2025 16:26:00 +0300 Subject: [PATCH] Fix pki/cer.c workability --- c/lib/pki/cer.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/c/lib/pki/cer.c b/c/lib/pki/cer.c index b4fe532..81eb105 100644 --- a/c/lib/pki/cer.c +++ b/c/lib/pki/cer.c @@ -18,8 +18,11 @@ KEKSCerParse( const size_t len) { struct KEKSItems *items = &(cer->items); - KEKSItemsInit(items); - enum KEKSErr err = KEKSItemsParse(items, off, buf, len); + enum KEKSErr err = KEKSItemsInit(items, 64); + if (err != KEKSErrNo) { + return err; + } + err = KEKSItemsParse(items, off, buf, len); if (err != KEKSErrNo) { return err; } @@ -87,7 +90,8 @@ KEKSCerParse( return KEKSErrUnsatisfiedSchema; } { - size_t pkidIdx = KEKSItemsGetByKeyAndType(items, idx, "id", KEKSItemUUID); + size_t pkidIdx = + KEKSItemsGetByKeyAndType(items, idx, "id", KEKSItemUUID); if (pkidIdx == 0) { (*failReason) = "no /load/v/pub/id"; return KEKSErrUnsatisfiedSchema; -- 2.50.0