ykpiv: when decoding an object compare lengths correctly

the length comparison when reading an object out was messed up, this
fixes it to compare correctly.

relates #154
This commit is contained in:
Klas Lindfors
2018-08-16 14:24:15 +02:00
parent c15efbfdd7
commit 16d539041e
+1 -1
View File
@@ -1282,7 +1282,7 @@ ykpiv_rc _ykpiv_fetch_object(ykpiv_state *state, int object_id,
if(offs == 0) {
return YKPIV_SIZE_ERROR;
}
if(outlen > offs + 1 + *len) {
if(outlen + offs + 1 != *len) {
if(state->verbose) {
fprintf(stderr, "Invalid length indicated in object, total objlen is %lu, indicated length is %lu.", *len, outlen);
}