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:
+1
-1
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user