Closed MarCovy closed 1 year ago
Hi @MarCovy,
The key information is this:
PD replied with NAK(6) for CMD(60)
Your PD responded with NAK error code 6. According to the spec this means "Communication security criteria not met". This error can be returned for a variety of reasons but in your case I think it is because you haven't set the SCBK to the PDs beforehand. LibOSDP will attempt to do this automatically (when you don't pass OSDP_FLAG_ENFORCE_SECURE
) but the catch is that, for this to work, the PD has to be put to a special state called "install mode".
Different PDs have different ways of doing this (also, I have explained some of the popular methods in other issues in this repository) so you'd have to look it up in the manual. Also, have you had a chance to read our documentation in https://libosdp.gotomain.io/libosdp/secure-channel.html about this? If not, I'd suggest you do that too.
Closing this issue, as it is a question. But feel free to re-open the issue and/or keep the discussion going.
Hello, I am using libosdp to connect to an Idesco reader with my Raspberry Pi. Everything is fine when I use a non-secure channel. I can ping my device, etc. Now, I want to switch to a secure channel for the connection. However, the library still wants to communicate with the reader using a non-secure channel. Is there any example or troubleshooting guide available for this case? Below, I have attached a part of my code and some fragments of the logs.
Expected behavior A CP should sent firstly CMD_KEYSET 0x75 to set encryption key.
Observed behavior Secure channel not starting.
CODE
A Comprehensive Log file