raise buffer sizes and remove a miss-leading error
This commit is contained in:
+1
-1
@@ -751,7 +751,7 @@ ykpiv_rc ykpiv_fetch_object(ykpiv_state *state, int object_id,
|
|||||||
ykpiv_rc ykpiv_save_object(ykpiv_state *state, int object_id,
|
ykpiv_rc ykpiv_save_object(ykpiv_state *state, int object_id,
|
||||||
unsigned char *indata, size_t len) {
|
unsigned char *indata, size_t len) {
|
||||||
|
|
||||||
unsigned char data[2048];
|
unsigned char data[3072];
|
||||||
unsigned char *dataptr = data;
|
unsigned char *dataptr = data;
|
||||||
unsigned char templ[] = {0, YKPIV_INS_PUT_DATA, 0x3f, 0xff};
|
unsigned char templ[] = {0, YKPIV_INS_PUT_DATA, 0x3f, 0xff};
|
||||||
int sw;
|
int sw;
|
||||||
|
|||||||
@@ -541,15 +541,11 @@ static bool import_cert(ykpiv_state *state, enum enum_key_format cert_format,
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
unsigned char certdata[2100];
|
unsigned char certdata[3072];
|
||||||
unsigned char *certptr = certdata;
|
unsigned char *certptr = certdata;
|
||||||
int object = get_object_id(slot);
|
int object = get_object_id(slot);
|
||||||
ykpiv_rc res;
|
ykpiv_rc res;
|
||||||
|
|
||||||
if(cert_len > 2048) {
|
|
||||||
fprintf(stderr, "Certificate to large, maximum 2048 bytes (was %d bytes).\n", cert_len);
|
|
||||||
goto import_cert_out;
|
|
||||||
}
|
|
||||||
*certptr++ = 0x70;
|
*certptr++ = 0x70;
|
||||||
certptr += set_length(certptr, cert_len);
|
certptr += set_length(certptr, cert_len);
|
||||||
if (compress) {
|
if (compress) {
|
||||||
@@ -1024,7 +1020,7 @@ static bool read_certificate(ykpiv_state *state, enum enum_slot slot,
|
|||||||
enum enum_key_format key_format, const char *output_file_name) {
|
enum enum_key_format key_format, const char *output_file_name) {
|
||||||
FILE *output_file;
|
FILE *output_file;
|
||||||
int object = get_object_id(slot);
|
int object = get_object_id(slot);
|
||||||
unsigned char data[2048];
|
unsigned char data[3072];
|
||||||
const unsigned char *ptr = data;
|
const unsigned char *ptr = data;
|
||||||
unsigned long len = sizeof(data);
|
unsigned long len = sizeof(data);
|
||||||
int cert_len;
|
int cert_len;
|
||||||
|
|||||||
Reference in New Issue
Block a user