goToMain / libosdp

Implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol); provides a C library with support for C++, Rust and Python3
https://libosdp.sidcha.dev
Apache License 2.0
128 stars 69 forks source link

Increasing the max data contained in an OSDP event to 128bytes #152

Closed dmercer-google closed 6 months ago

dmercer-google commented 6 months ago

This is necessary because we are dealing with a Manufacturer Specific Response that contains at least 73 bytes of date. The data is an ASN.1 serialized ECDSA P256 signature. In the case of larger curves (e.g. P384) the signature will be longer but 128 bytes will handle it fine. In the case of RSA signatures it is almost for sure that 128bytes will be too small but that is not a use case we are concerned with at the moment nor is it one we can test.

Sympatron commented 6 months ago

Won't this greatly increase memory consumption? If so, I don't think this would be a good default then. I did not check yet, but I would expect the RAM usage to increase by 2KB with OSDP_CP_CMD_POOL_SIZE=32.

sidcha commented 6 months ago

@Sympatron, I was aware of this when I merged the change. I wasn't worried because that whole issue is due to a relic design decision of having internal and external command use the same structure. I plan on spending some time to decouple those two and then OSDP_CP_CMD_POOL_SIZE will be exclusively meant for internal commands which is at most a few bytes each.