Commit Graph

3161 Commits

Author SHA1 Message Date
Steve Karg bd597082d2 Fix ReinitializeDevice service handling of optional password (#487)
* Fix ReinitializeDevice service handling of optional password

* Improve ReinitializeDevice service unit testing

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-08 14:58:04 -05:00
Steve Karg f641aacddb Bugfix/deprecate decode tag number and value (#481)
* added or updated secure the BACnet primitive value decoders - the core codecs - named bacnet_x_decode(), bacnet_x_application_decode() and bacnet_x_context_decode where x is one of the 13 BACnet primitive value names.  The updated API includes an APDU size to prevent over-reading of an APDU buffer while decoding.  Improved or added unit test code coverage for the BACnet primitive value decoders.

* marked the insecure decoding API as 'deprecated' which is defined in src/bacnet/basic/sys/platform.h and can be disabled during a build. 

* added secure decoders for BACnetTimeValue, BACnetHostNPort, BACnetTimeStamp, BACnetAddress, and Weekly_Schedule and improved unit test code coverage.

* improved test code coverage for BACnet objects and properties.

* secured AtomicReadFile and AtomicWriteFile service decoders and improved unit test code coverage.

* secured BACnet Error service decoder and improved unit test code coverage.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-09-08 11:39:27 -05:00
dependabot[bot] bc8c261153 Bump actions/checkout from 3 to 4 (#484)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 13:53:52 -05:00
Steve Karg f61f4300be Feature/add create object service (#476)
Added BACnet CreateObject and DeleteObject services

* refactored codec for BACnetPropertyValue into bacapp module
* added unit tests for BACnetPropertyValue
* refactored COV and Events to use BACnetPropertyValue codec API
* added unit tests for COV
* added overrun safe decoders for tag numbers and boolean context
* added unit tests and codecs for CreateObject and DeleteObject services
* added APDU service handers and senders for CreateObject and DeleteObject services
* added command line apps bacco and bacdo for CreateObject and DeleteObject services
* added CreateObject and DeleteObject service handling in example server app and device object
* added new BACnetRejectReason, Error Class, and BACnetAbortReason enumerations and conversions

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-28 13:02:35 -05:00
Steve Karg 8184afea12 Chore/make test parallel build limits (#480)
* re-enable parallel build for CMake unit tests, but limited to ncores on supported OSes. Using MAKEFLAGS in .bashrc to set the '-j' flag size causes problem for Makefile build of BACnet library which doesn't tolerate parallel builds.  Using "-j" without limits for CMake of unit tests overwhelms my lesser endowed build machines.

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-25 15:15:32 -05:00
Steve Karg c383514a62 Chore/fix release script tools archive (#479)
* fix the tool archive for release script

* fix the source archive for release script

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-25 11:17:30 -05:00
Steve Karg 58a6373ffb Update release.yml (#472)
fix tag name from releases
2023-08-21 08:56:24 -05:00
Steve Karg ac9b99d46c Update change log for v1.1.2 2023-08-18 15:20:24 -05:00
Steve Karg 8a4d530caf Incremented version to 1.1.2 for release on 18-Aug-2023 2023-08-18 15:20:14 -05:00
Steve Karg a7012fbd12 Feature/add release script (#471)
* add release script

* updated changelog

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-18 14:59:01 -05:00
Steve Karg 2a15a451d0 improve router-mstp app usage (#470)
* improve router-mstp app usage

* add router-mstp app environment shell script

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-15 11:24:22 -05:00
Steve Karg 2b35883df6 Added MSTP Slave Node option to stm32f10x port (#467)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-08-07 09:45:30 -05:00
anthony-crystalpeak acb3b0f57d [libbacnet]: bacapp_data_len() + bacnet_tag_number_and_value_decode() (#453)
* Bugfix: bacapp_data_len() + bacnet_tag_number_and_value_decode()

* Fix bacnet_tag_number_and_value_decode function.
Add read buffer safe functions for opening, closing, context specific tags.
Fix bacapp_data_len function changes as indicated by unit testing.

* refactor bacapp_data_len
---------
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-31 16:50:14 -05:00
Mateusz Klatecki 28de333b6e Fix encode_context_bacnet_address (#464)
the original solution caused that after encode_bacnet_address the apdu pointer was moved too far because apdu_len took into account the length of the opening_tag
2023-07-31 11:24:25 -05:00
Greg Shue dad9e13485 Issues/issue 461 update to zephyr v3 4 0 in ci (#463)
* [WIP] Remove unit testcases duplicated under non-unit tree

* [WIP] Update west.yml to Zephyr v3.3.0 (twister verified)

* Update CI to Zephyr v3.4.0 w/ reduced module set

- Update zephyr/module.yml to use Zephyr v3.4.0 + cmsis;
- Update tests to use ZTEST_NEW_API for zephyr builds

Verified by:

1. make clean test
2. ./zephyr/scripts/twister -p unit_testing -T bacnet/zephyr/tests/bacnet

---------

Co-authored-by: Gregory Shue <gregory.shue@legrand.com>
2023-07-26 14:47:01 -07:00
Greg Shue 3f7a4d2e19 Trim west.yml imported repository set (#460) (#462)
Verified by:

1. cd $workspace && \
   rm -rf modules/ && \
   west update && \
   zephyr/scripts/twister -p unit_testing \
      -T bacnet-stack/zephyr/tests/

   Visually verified all tests passed.

Signed-off-by: Greg Shue <greg.shue@outlook.com>
2023-07-24 20:36:03 -05:00
Steve Karg 077be0005f Fix spurious interrupts from STM32 ORE (#456)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-17 13:49:59 -05:00
Steve Karg 7db03ac5e5 Fix spurious interrupts from STM32 ORE (#456)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-17 13:49:40 -05:00
anthony-crystalpeak fcc9647983 AFL + Libfuzzer harnesses (#455)
* Package fuzzers

* Provide ability to remove main

* Don't build fuzzers by default
2023-07-17 10:06:32 -05:00
Steve Karg 9e7f8978fa fix router apps action for unknown dnet (#454)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-13 16:52:30 -05:00
anthony-crystalpeak da4db7c65e BUG: Prevent npdu_len from wrapping around at npdu_len=1 (#452) 2023-07-13 14:44:48 -05:00
anthony-crystalpeak 758cac3bed DOS: port might be null (#451) 2023-07-13 14:12:38 -05:00
Steve Karg 2bf1e9a548 Bugfix/writeproperty app known property (#450)
* Fix write-property app known property option

* Fix write-property app priority handling

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-13 10:21:21 -05:00
Steve Karg 4efaf097c0 Fix [bug#80] npdu_decode via deprecation (#447)
* Fix [bug#80] npdu_decode via deprecation

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-10 17:27:10 -05:00
Steve Karg 13c85db4cb Fix [bug#79] Out of bounds jump in h_apdu.c:apdu_handler (#446)
* Fix [bug#79] Out of bounds jump in h_apdu.c:apdu_handler
---------
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-10 15:15:55 -05:00
Steve Karg 1cfe6ee80f update change log 2023-07-08 09:49:43 -05:00
Jefrin da8f93ad79 Fix segfault on mstp cleanup on linux port (#445) 2023-07-08 09:47:50 -05:00
Steve Karg 7bac8aa0bd Add bitstring to minimal config (#443)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-08 09:14:23 -05:00
Steve Karg dbed4040ae Improve MSTP debug. Fix WhoIs app APDU timeout. (#444)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-07-08 09:13:56 -05:00
Steve Karg 95174ce96e added changelog. updated security statement. 2023-07-02 09:43:01 -05:00
Steve Karg d9d61b4ba7 Merge remote-tracking branch 'origin/master' into bacnet-stack-1.1 2023-06-30 17:49:05 -05:00
Steve Karg cfe3086ae5 increment version to 1.1.1 for release on 30-June-2023 2023-06-30 17:09:02 -05:00
Steve Karg b676f09c4b Merge branch 'master' 2023-06-30 17:04:23 -05:00
Steve Karg a9c2474534 Fix BACnetARRAY encoder for index=ALL (#442)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-06-30 15:39:15 -05:00
Steve Karg 5b7eac60cf cleaned up lwIP function header javadoc (#441)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-06-28 12:46:56 -05:00
Steve Karg db21bf1bfa Increment version to 1.1.0 for release 2023-06-25 09:32:15 -05:00
Steve Karg a4750b8999 Increment version to 1.1.0 for release 2023-06-25 09:31:07 -05:00
Steve Karg 9bb367982b Improve MSTP debug. Fix WhoIs app APDU timeout. 2023-06-25 09:27:05 -05:00
Steve Karg c8a6ea74b8 Fix WPM decoding. Add unit test for WPM. (#438)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-06-14 17:25:38 -05:00
Steve Karg 2c771414bd fix BACnet Array size encoding (#437)
* fix BACnet Array size encoding

* test BACnet Array size encoding

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-06-14 17:13:52 -05:00
Steve Karg 6e5524bee3 Create SECURITY.md 2023-05-30 14:34:04 -05:00
Steve Karg 5e0f7b79ef Fix potential XSS vulnerability in jQuery #1 (#436)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-30 14:24:47 -05:00
Steve Karg 682d913686 fix compiler warnings for C89 builds (#433)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-22 08:49:17 -05:00
Ondřej Hruška dab95eec3f Implement parsing for proprietary events (complex-event-type) (#420)
* Implement parsing for proprietary events (complex-event-type)

* Fix unit test linking for event.c
---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-16 23:55:55 -05:00
Steve Karg c02a8281a7 Cleanup win32 build warnings (#431)
* Cleanup win32 build warnings

* Add README for MinGW32 build under Windows

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-13 15:13:15 -05:00
Steve Karg f59a460292 Fixed array index out of range for binary-value, multistate-output, and lighting-output objects. Thanks, Roy! (#430)
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-09 15:58:28 -05:00
Steve Karg 65792ab408 Update address in VMAC table for IPv6 (#429)
* Update address in VMAC table for IPv6

* fix compile warnings in IPv6 handler

* cleanup BIP6 PRINTF

* enable unit test for BBMD6 hander

* keylist should only return FALSE when growing fails

---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-05-03 23:33:06 -05:00
Steve Karg ced9dff0f2 Added AddListElement and RemoveListElement services (#418)
* Added AddListElement and RemoveListElement services

Added list-element codec and unit tests.
Added BACnetDestination codec and unit tests.
Added RecipientList handling to NotificationClass object.
Added AddListElement and RemoveListElement client example app.

* Fix defects found by scan-build and CPPCHECK

* Update ports errors found during CI builds

* Update zephy os test build missing files in CMakeLists

---------

Co-authored-by: Ondřej Hruška <ondra@ondrovo.com>
Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-04-16 14:12:11 -05:00
Steve Karg e517df0d47 Bugfix/bacnet array encoding overflows (#414)
* Add common BACnetARRAY encode function to fix Device object list buffer overflow. Refactor device, analog-output, access-door and binary-output objects to use common BACnetARRAY encoder.

* Fix non-POSIX builds (win32).

* Cleanup some ports/stm32 build warnings
---------

Co-authored-by: Steve Karg <skarg@users.sourceforge.net>
2023-04-13 20:43:54 -05:00
jci-zimm 064c6f7f1c MSTP stat lost_token_counter was missing a drop case (#421)
Co-authored-by: jzimmen_jcplc <nathan.m.zimmerman@jci.com>
2023-04-13 20:36:22 -05:00