don't try to parse returned data if it was an error
This commit is contained in:
+1
-3
@@ -666,13 +666,11 @@ ykpiv_rc ykpiv_fetch_object(ykpiv_state *state, int object_id,
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
if(sw == 0x9000) {
|
||||||
size_t outlen;
|
size_t outlen;
|
||||||
int offs = get_length(data + 1, &outlen);
|
int offs = get_length(data + 1, &outlen);
|
||||||
memmove(data, data + 1 + offs, outlen);
|
memmove(data, data + 1 + offs, outlen);
|
||||||
*len = outlen;
|
*len = outlen;
|
||||||
}
|
|
||||||
if(sw == 0x9000) {
|
|
||||||
return YKPIV_OK;
|
return YKPIV_OK;
|
||||||
} else {
|
} else {
|
||||||
return YKPIV_GENERIC_ERROR;
|
return YKPIV_GENERIC_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user