trussed-dev / ctap-types

3 stars 9 forks source link

Handle overlong icon values #27

Closed robin-nitrokey closed 8 months ago

robin-nitrokey commented 8 months ago

We skip the icon field during deserialization if it is too long. Previously, we directly tried to deserialize a String and ignored any errors. This means that we also ignored any other errors, e. g. for invalid data types.

This patch changes the implementation to first deserialize a string slice and handle errors occuring during the deserialization. Then we check if the string slice fits into String or if we should ignore the value.