Do not repeat the size of certdata

This commit is contained in:
Michael Scherer
2016-05-04 23:17:43 +02:00
committed by Michael Scherer
parent 1a525f7ed7
commit ff67119447
+1 -1
View File
@@ -557,7 +557,7 @@ static bool import_cert(ykpiv_state *state, enum enum_key_format cert_format,
int object = get_object_id(slot); int object = get_object_id(slot);
ykpiv_rc res; 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"); fprintf(stderr, "Certificate is to large to fit in buffer.\n");
goto import_cert_out; goto import_cert_out;
} }