Changelog

v2.0.0

19 September 2021

This major release brings support for new features added in IEC Edition 1.0 of the OSDP specification and other bug fixes and API changes.

Enhancements:
  • pytest: Add test coverage in pytest

  • sc: Fix API inconsistency in compute_session_keys()

  • libosdp: Deprecate ad-hoc unit testing

  • libosdp: Document members of struct osdp and struct osdp_pd

  • pyosdp: Add support for file transfer command

  • CP: Add public method to get PD ID and capability

  • Tiny-AES: Update source files to latest version

  • libosdp: Add support for MbedTLS

  • libosdp: Cleanup error handling between phy and CP/PD

  • Deprecate Master key based key derivation

  • Add support for OSDP File Transfer

  • Advertise and decode peer_size capability

  • Add support for CMD_ABORT, CMD_ACURXSIZE, CMD_KEEPACTIVE

  • Add support for additional baud rates 19200 and 230400

Fixes:
  • libosdp: Change API to handle any number PDs in get_(sc_)status_mask

  • libosdp: Double SC timeout to be a bit more flexible

  • PD: Fix bug when phy wants wait for more data by PD discards rx_buf

  • PD: Fix packet trace logging of sent bytes

  • libosdp: USE_SCBK-D has a higher precedence in choice of SCBK

  • file_tx: Many fixes and enhancements

  • libosdp: Fix slab_free() assertion bug in release builds

  • SC: Fix SCBK clobber in osdp_compute_session_keys()

  • libosdp: Discard Secure Channel if a KEYSET is ACKed in plaintext

  • CP: Fix packet consumption from rx_buffer issue

  • cp: Allow applications to KEYSET with SCBK or master_key

  • Fix: Allow keyset with SCBK; guard master_key route with ENFORCE_SECURE

  • Ignore reply packet coming from another PD.

  • Fix the master key check in osdp_cp_setup()

v1.5.0

17 April 2021

This release marks the end of OSPD specification v2.1.6 support. Post this release, LibOSDP would start supporting new features added in IEC Edition 1.0 specification.

Features:
  • libosdp: Introduce a lean-build system

  • tests: Add a command level unit test executor

  • libosdp: Add new command complete callback

Enhancements:
  • libosdp: Add cmake option CONFIG_OSDP_STATIC_PD (configure –static-pd)

  • pd: Use better NAK error code when rejecting a command due to SC inactive

  • LibOSDP: Split build/send and receive/decode methods

  • Add new typedef and document osdp_log_fn_t

  • Remove implicit logging via printf()

  • Avoid allocs by switching log buf to static char[]

  • Add compile time switch to disable colours in osdp logs

  • Add Makefile target to clone utils submodules at init

  • phy: Allow non-conformant, 0 length, encrypted data blocks

  • cp: Add bounded exponential back-off for offline retries

  • cp: Add detection of a busy reply with sequence number 0

  • Mark some methods with __weak for portability

Fixes:
  • Clean src/osdp_cp.o even if it is not built due to –single-pd

  • Just fix the description comment for OSDP_PD_NAK_SEQ_NUM

  • Call osdp_logger_init() before setting up CP/PD for early logging

  • Fix off-by-one at vsnprintf()’s return value assertion

  • Move osdp_millis_*() into utils::utils.c

  • Move unistd.h into CONFIG_DISABLE_PRETTY_LOGGING guard

  • Enable github workflows on lean build to keep them in sync

  • Fix coverity identified off-by-one out-of-bound array access

  • Fix coverity identified logical dead-code

  • sc: Fix potential out-of-bound buffer access

  • cp: Bypass unneeded packet decoding for a busy reply

  • cp: Don’t regenerate random numbers for the challenge command

  • cp: Add the OSDP_ONLINE_RETRY_WAIT_MS timeout

  • pd: Fix device capabilities report

  • Call to osdp_dump was using incorrect length

v1.4.0

31 January 2021

This relase brings in a lot of bug fixes and some minor enhancements.

Enhancements:
  • doc: Add Doxygen and breathe to talk with sphinx

  • LibOSDP: Add osdp.hpp and cpp samples

  • cp: Add new flag FLAG_SC_DISABLED when master_key == NULL

  • Add support for adpative MARK bytes on packets

  • libosdp: consume only processed bytes from rx_buf

  • test: Get test log level from test context

  • Add a toplevel cmake offload makefile

  • PD: Add API osdp_pd_set_capabilities()

  • PD: Add CAP validation on received commands

  • PD: Allow only specific commands in plain text when ENFORCE_SECURE

  • Consume new hexdump API; Modify packet_trace logs

  • Move src/include/* to src/ for simplicity

  • PD: Reset SC active status bit when there is a timeout

  • pyosdp: promote set_loglevel() as osdp class static method

  • libosdp: Add support for multiple PDs connected in a single channel

  • Add compile time switch CONFIG_OSDP_SKIP_MARK_BYTE

  • Allow LibOSDP to export its build rules to other modules

  • libosdp: Optionally, find and use openssl if available

Fixes:
  • pyosdp: cp: change type of master_key to python bytes

  • cp: Fix master keyset functionality

  • libosdp: cleanup logs and remove some duplicate code

  • Fix python warnings – bugs

  • Disambiguate logging macro from the loglevel enum entry

  • CP: Fix some ENFORCE_SECURE holes

  • Reset seq_number before moving to ONLINE without SC

  • fix: map the public osdp_cmd_e id codes when sending commands to the OSDP API function osdp_cp_send_command()

  • fix in using correct context pointer for PD (pd_ctx instead of cp_ctx)

  • The PD address 0 is also a valid address!

  • Fix the check of the checksum of received packets.

  • Avoid receiving invalid data by flushing rx before each send.

  • do not flush rx queue when skipping commands. when skipping commands addressed to other nodes the rx queue should not be flushed. The complete command is already received and flushing the rx queue only risks removing bytes in the next command.

  • PD: Discard SC flag on MAC verification and decryption errors

  • Fix REPLY_RAW card data length bug - Related-To: #31

  • Fix constant time compare in osdp_ct_compare()

  • pyosdp: fix untested PD capabilities code flow

  • Fix CONFIG_OSDP_PACKET_TRACE that was flooding logs with osdp_POLL

  • cp: Fix unexpected reply condition missing break

  • Fix osdp_event_cardread length bits/bytes mixup

v1.3.0

16 September 2020

With this release, LibOSDP now has python bindings. It is possible to setup a device as a Control Panel or Peripheral Device through python. Also, PD now supports alternate replies in the form of OSDP events.

Enhancements:
  • libosdp: Add flag ENFORCE_SECURE to make secure assumptions

  • libosdp: Resolve PD address / offset inconsistencies

  • libosdp: Remove CONFIG_OSDP_SC_ENABLED macro switch

  • libosdp: deprecate osdp_cp_send_cmd_*() methods in favour of osdp_cp_send_command()

  • libosdp: add PD app command callback support

  • Make OSDP_FLAG_INSTALL_MODE a setup time flag

  • Add support for manufacturer specific commands

  • Add support for osdp_FMT, osdp_RAW, osdp_KEYPAD and handle their osdp_events

  • Move command alloc/queue API into CP region

  • Add checks that a pd is online before queueing commands.

  • osdpctl: consume utils/channel.c and remove native impl

  • libosdp: Add support for callback data in notifiers

Fixes:
  • Fix srand issue in tests, pyosdp, and osdpctl

  • PD: Fix bug PD_FLAG_SC_ACTIVE not removed when PD goes offline

  • PD: always check the timeout on receiving packets

  • libosdp: Deprecate command queues for PD mode

  • Add osdp_events and make changes globally

  • Fix multiple checkpactch issues found in zephyr upstream

  • Move PD offset validation above context dereference

  • Move COMSET out of CONFIG_OSDP_SC_ENABLED macro guard

  • libosdp: fix COMSET command regression

  • Refactor some command struct members for consistency

  • Fix python memory leak and python keyset error check.

  • libosdp: Fix bug in PD_MASK() macro

  • libosdp: fix missing cmd_dequeue return check

  • Rebuild utils with -fPIC to fix gcc/linux build issues

  • doc: Add protocol/faq update README.md

  • Consume slab allocation from utils and remove native implementation

  • Return aligned memory from slab allocator.

  • Fix doc links in README.md

  • Fix multiple broken links in doc/ after sphinx move

  • Update AES to to latest kokke/tiny-AES-c

v1.2.0

15 August 2020

This release marks the first HEAD of initial PD support in Zephyr RTOS upstream (https://github.com/zephyrproject-rtos/zephyr). Lot of changes to coding style were made to upstream the PD sources without too much variation to the one here.

Enhancements:
  • Add support for sphinx documentation builds see: https://libosdp.gotomain.io

  • Add a macro switch to disable Secure Channel

  • Add utils git-submodule and delete all copied ad-hoc utils from this repo

  • Add pkg-config file for libosdp

  • PD: When seq number 0 is received, invalidate SC status

  • Add github actions workflows for tests and release

  • Rewrite PD and CP fsm for zephyr integration

  • osdpctl: rewrite rs232.c into utils/serial.c

  • osdpctl: remove pid file in osdpctl stop. Also check return code of kill

  • Produce source and binary tarballs with cPack

  • Bring changes from zephyr PD, post review and apply it to CP as well

  • Control the externally exposed library symbols using EXPORT macro

Fixes:
  • Make all internal methods static; scope all globals with osdp_

  • Add colors for various log levels of libosdp

  • Refactor all reference to struct osdp_pd as ‘pd’ everywhere

  • Fix static analysis issues identified by Xcode

  • travis: switch to Ubuntu 18.04 bionic for testing

  • osdpctl: Fix bug in hex2int()

  • osdpctl: Fix bug in load_scbk(); test key_store feature

  • osdpctl make config as the first argument for all commands

  • Fix sequence number 0 sent by CP does not reset connection in PD

  • osdpctl: Make PD message queue channel owner, responsible for cleanup

  • osdpctl: Fix segfault on channel cleanup code

v1.1.0

28 June 2020

This release bumps up the minor number as the contract has changed. It introduces 2 major changes (first 2 in enhancements). The rest is all re-organization and fixes.

Enhancements:
  • In PD Change app notification of incoming commands to polling to simplify API

  • Replace circular buffer command queue with linked list queue

  • Add SC status and status query methods

  • Add assert guards for exposed methods

  • Cleanup osdp.h by splitting it into multiple files

  • Split cmake rules into subdirectories

Fixes:
  • Add PD address to REPLY_COM in pd_build_reply

  • Fix fd leak in read_pid

  • Fix missing null char at atohstr()

  • Fix memory under-alloc due to operator precedence issues

v1.0.0

29 May 2020

This is the first release of libosdp. It has been in pre-release for a long time now and has been tested sufficiently well for a first release. Rate of bug fixes has gone down significantly.

As of this release, libosdp has the following high level feature:
  • Supports OSDP CP mode of operation

  • Supports OSDP PD mode of operation

  • Supports Secure Channel for communication

  • Ships a tool: osdpctl to consume and library and setup/manage osdp devices

  • Documents key areas in the protocol that are of interest for consumers of this library.

So far, this library’s CP implementation has been tested with multiple OSDP PDs including HID’s devices and found to be working as expected. The PD implementation has been tested with it’s own CP counterpart so this some level of confidence on the that too.

v0.4 Beta - 3

17 Jan 2020

Fix multiple bugs found in LibOSDP:
  • fix unhandled reply-code bug

  • fix issue where reader goes permanent reader offline

  • retry SC after OSDP_PD_SC_RETRY_SEC when possible

  • fix USE_SCBKD inversion bug

  • fix bug in MAC add/check for SCS_15

Note: This tag has CP mode verified with HID RK40 readers. This can act as reference point for all PD change validation hereafter.

v0.3 Beta - 2

15 Dec 2019

New Features:
  • Added new tool osdpctl to create, manage and control osdp devices

  • Add PD context to CP logs for clarity

Enhancements and bug fixes:
  • Fix PD stale pointer issue in osdp_setup

  • Fix MAC generation bug in Secure Channel

  • Fix Data offset bug in Secure Channel

  • Fix issues reported by -Wimplicit-fallthrough

  • Fix memleak in PD command queue alloc

  • Fix wrap around bug in cmd_queue

  • Fix many clang static code analysis issues

v0.2 Beta - 1

29 Nov 2019

Features and Issue Fixes:
  • Master key management in CP and PD

  • Many small issue fixes

Known limitations:
  • install mode stuffs need to be ironed out comset command needs to be

  • handled correctly

v0.1 Alpha

15 Nov 2019

libosdp has reached a point where all the primary featured are in place.

Known limitations:
  • Master key management is missing

  • Install mode stuffs need to be ironed out

  • comset command needs to be handled correctly