Skip to content

C_GetInfo() to p11-kit-client.so returns empty object #156

@andsens

Description

@andsens

image

I don't exactly know why this happens, but it becomes a breaking bug in graphene.
removePadding(text: string) specifically cannot handle undefined as a parameter.

I tried making a patch for this, but I'm not really sure where this should be handled idiomatically.

For now I'm just patching core/type.ts:

diff --git a/src/core/type.ts b/src/core/type.ts
index 1b3c2b0..e0eb075 100644
--- a/src/core/type.ts
+++ b/src/core/type.ts
@@ -84,5 +84,5 @@ export function isFlag(v: number, fv: number) {
  * @param text Formatted string
  */
 export function removePadding(text: string) {
-  return text.replace(/\0.*/g, "").trim();
+  return text ? text.replace(/\0.*/g, "").trim() : text;
 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions