diff --git a/lib/ykpiv.c b/lib/ykpiv.c index 468d9ef..460dc96 100644 --- a/lib/ykpiv.c +++ b/lib/ykpiv.c @@ -61,7 +61,7 @@ static int set_length(unsigned char *buffer, int length) { } } -static int get_length(unsigned char *buffer, size_t *len) { +static int get_length(const unsigned char *buffer, size_t *len) { if(buffer[0] < 0x81) { *len = buffer[0]; return 1; diff --git a/tool/util.c b/tool/util.c index 79097cc..6cebd65 100644 --- a/tool/util.c +++ b/tool/util.c @@ -150,7 +150,7 @@ void dump_hex(const unsigned char *buf, unsigned int len) { } } -int get_length(unsigned char *buffer, int *len) { +int get_length(const unsigned char *buffer, int *len) { if(buffer[0] < 0x81) { *len = buffer[0]; return 1; diff --git a/tool/util.h b/tool/util.h index fe314fc..acb5811 100644 --- a/tool/util.h +++ b/tool/util.h @@ -51,7 +51,7 @@ typedef union u_APDU APDU; void dump_hex(unsigned const char*, unsigned int); int set_length(unsigned char*, int); -int get_length(unsigned char*, int*); +int get_length(const unsigned char*, int*); X509_NAME *parse_name(const char*); unsigned char get_algorithm(EVP_PKEY*); FILE *open_file(const char*, int);