diff --git a/tool/yubico-piv-tool.c b/tool/yubico-piv-tool.c index c244a37..0a93044 100644 --- a/tool/yubico-piv-tool.c +++ b/tool/yubico-piv-tool.c @@ -557,7 +557,7 @@ static bool import_cert(ykpiv_state *state, enum enum_key_format cert_format, int object = get_object_id(slot); ykpiv_rc res; - if(4 + cert_len + 5 > 3072) { /* 4 is prefix size, 5 is postfix size */ + if(4 + cert_len + 5 > sizeof(certdata)) { /* 4 is prefix size, 5 is postfix size */ fprintf(stderr, "Certificate is to large to fit in buffer.\n"); goto import_cert_out; }