libosdp 3.2.5__tar.gz → 3.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. {libosdp-3.2.5 → libosdp-3.2.6}/PKG-INFO +6 -6
  2. {libosdp-3.2.5 → libosdp-3.2.6}/README.md +4 -4
  3. {libosdp-3.2.5 → libosdp-3.2.6}/libosdp.egg-info/PKG-INFO +6 -6
  4. {libosdp-3.2.5 → libosdp-3.2.6}/setup.py +2 -2
  5. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_common.h +5 -5
  6. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_config.h +3 -3
  7. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_cp.c +2 -2
  8. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_diag.c +1 -1
  9. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_pd.c +28 -13
  10. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_phy.c +2 -2
  11. {libosdp-3.2.5 → libosdp-3.2.6}/MANIFEST.in +0 -0
  12. {libosdp-3.2.5 → libosdp-3.2.6}/libosdp.egg-info/SOURCES.txt +0 -0
  13. {libosdp-3.2.5 → libosdp-3.2.6}/libosdp.egg-info/dependency_links.txt +0 -0
  14. {libosdp-3.2.5 → libosdp-3.2.6}/libosdp.egg-info/top_level.txt +0 -0
  15. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/__init__.py +0 -0
  16. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/channel.py +0 -0
  17. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/constants.py +0 -0
  18. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/control_panel.py +0 -0
  19. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/helpers.py +0 -0
  20. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/key_store.py +0 -0
  21. {libosdp-3.2.5 → libosdp-3.2.6}/osdp/peripheral_device.py +0 -0
  22. {libosdp-3.2.5 → libosdp-3.2.6}/pyproject.toml +0 -0
  23. {libosdp-3.2.5 → libosdp-3.2.6}/setup.cfg +0 -0
  24. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/include/osdp.h +0 -0
  25. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/include/osdp_export.h +0 -0
  26. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/base.c +0 -0
  27. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/cp.c +0 -0
  28. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/data.c +0 -0
  29. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/module.c +0 -0
  30. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/module.h +0 -0
  31. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/pd.c +0 -0
  32. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/python/osdp_sys/utils.c +0 -0
  33. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/crypto/tinyaes.c +0 -0
  34. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/crypto/tinyaes_src.c +0 -0
  35. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/crypto/tinyaes_src.h +0 -0
  36. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_common.c +0 -0
  37. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_diag.h +0 -0
  38. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_file.c +0 -0
  39. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_file.h +0 -0
  40. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/src/osdp_sc.c +0 -0
  41. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/assert.h +0 -0
  42. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/crc16.h +0 -0
  43. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/disjoint_set.h +0 -0
  44. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/list.h +0 -0
  45. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/logger.h +0 -0
  46. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/pcap_gen.h +0 -0
  47. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/queue.h +0 -0
  48. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/slab.h +0 -0
  49. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/include/utils/utils.h +0 -0
  50. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/crc16.c +0 -0
  51. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/disjoint_set.c +0 -0
  52. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/list.c +0 -0
  53. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/logger.c +0 -0
  54. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/pcap_gen.c +0 -0
  55. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/queue.c +0 -0
  56. {libosdp-3.2.5 → libosdp-3.2.6}/vendor/utils/src/utils.c +0 -0
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libosdp
3
- Version: 3.2.5
3
+ Version: 3.2.6
4
4
  Summary: Library implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol)
5
- Home-page: https://github.com/goToMain/libosdp
5
+ Home-page: https://github.com/osdp-dev/libosdp
6
6
  Author: Siddharth Chandrasekaran
7
7
  Author-email: sidcha.dev@gmail.com
8
8
  Classifier: Programming Language :: Python :: 3
@@ -42,13 +42,13 @@ pip install libosdp
42
42
  Or, from github,
43
43
 
44
44
  ```sh
45
- pip install -e "git+https://github.com/goToMain/libosdp#egg=libosdp&subdirectory=python"
45
+ pip install -e "git+https://github.com/osdp-dev/libosdp#egg=libosdp&subdirectory=python"
46
46
  ```
47
47
 
48
48
  Or, from source using,
49
49
 
50
50
  ```sh
51
- git clone https://github.com/goToMain/libosdp --recurse-submodules
51
+ git clone https://github.com/osdp-dev/libosdp --recurse-submodules
52
52
  cd libosdp/python
53
53
  python3 setup.py install
54
54
  ```
@@ -141,5 +141,5 @@ pd.set_event_completion_handler(on_event_complete)
141
141
  ```
142
142
 
143
143
  [1]: https://doc.osdp.dev/api/
144
- [2]: https://github.com/goToMain/libosdp/blob/master/examples/python/cp_app.py
145
- [3]: https://github.com/goToMain/libosdp/blob/master/examples/python/pd_app.py
144
+ [2]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/cp_app.py
145
+ [3]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/pd_app.py
@@ -21,13 +21,13 @@ pip install libosdp
21
21
  Or, from github,
22
22
 
23
23
  ```sh
24
- pip install -e "git+https://github.com/goToMain/libosdp#egg=libosdp&subdirectory=python"
24
+ pip install -e "git+https://github.com/osdp-dev/libosdp#egg=libosdp&subdirectory=python"
25
25
  ```
26
26
 
27
27
  Or, from source using,
28
28
 
29
29
  ```sh
30
- git clone https://github.com/goToMain/libosdp --recurse-submodules
30
+ git clone https://github.com/osdp-dev/libosdp --recurse-submodules
31
31
  cd libosdp/python
32
32
  python3 setup.py install
33
33
  ```
@@ -120,5 +120,5 @@ pd.set_event_completion_handler(on_event_complete)
120
120
  ```
121
121
 
122
122
  [1]: https://doc.osdp.dev/api/
123
- [2]: https://github.com/goToMain/libosdp/blob/master/examples/python/cp_app.py
124
- [3]: https://github.com/goToMain/libosdp/blob/master/examples/python/pd_app.py
123
+ [2]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/cp_app.py
124
+ [3]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/pd_app.py
@@ -1,8 +1,8 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: libosdp
3
- Version: 3.2.5
3
+ Version: 3.2.6
4
4
  Summary: Library implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol)
5
- Home-page: https://github.com/goToMain/libosdp
5
+ Home-page: https://github.com/osdp-dev/libosdp
6
6
  Author: Siddharth Chandrasekaran
7
7
  Author-email: sidcha.dev@gmail.com
8
8
  Classifier: Programming Language :: Python :: 3
@@ -42,13 +42,13 @@ pip install libosdp
42
42
  Or, from github,
43
43
 
44
44
  ```sh
45
- pip install -e "git+https://github.com/goToMain/libosdp#egg=libosdp&subdirectory=python"
45
+ pip install -e "git+https://github.com/osdp-dev/libosdp#egg=libosdp&subdirectory=python"
46
46
  ```
47
47
 
48
48
  Or, from source using,
49
49
 
50
50
  ```sh
51
- git clone https://github.com/goToMain/libosdp --recurse-submodules
51
+ git clone https://github.com/osdp-dev/libosdp --recurse-submodules
52
52
  cd libosdp/python
53
53
  python3 setup.py install
54
54
  ```
@@ -141,5 +141,5 @@ pd.set_event_completion_handler(on_event_complete)
141
141
  ```
142
142
 
143
143
  [1]: https://doc.osdp.dev/api/
144
- [2]: https://github.com/goToMain/libosdp/blob/master/examples/python/cp_app.py
145
- [3]: https://github.com/goToMain/libosdp/blob/master/examples/python/pd_app.py
144
+ [2]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/cp_app.py
145
+ [3]: https://github.com/osdp-dev/libosdp/blob/master/examples/python/pd_app.py
@@ -12,7 +12,7 @@ import shutil
12
12
  import subprocess
13
13
 
14
14
  project_name = "libosdp"
15
- project_version = "3.2.5"
15
+ project_version = "3.2.6"
16
16
  current_dir = os.path.dirname(os.path.realpath(__file__))
17
17
  repo_root = os.path.realpath(os.path.join(current_dir, ".."))
18
18
 
@@ -229,7 +229,7 @@ setup(
229
229
  author = "Siddharth Chandrasekaran",
230
230
  author_email = "sidcha.dev@gmail.com",
231
231
  description = "Library implementation of IEC 60839-11-5 OSDP (Open Supervised Device Protocol)",
232
- url = "https://github.com/goToMain/libosdp",
232
+ url = "https://github.com/osdp-dev/libosdp",
233
233
  ext_modules = [
234
234
  Extension(
235
235
  name = "osdp_sys",
@@ -492,9 +492,9 @@ void osdp_sc_teardown(struct osdp_pd *pd);
492
492
 
493
493
  static inline uint16_t bread_u16_le(const uint8_t *buf, int *pos)
494
494
  {
495
- uint16_t v = buf[(*pos)++];
496
- v |= (uint16_t)buf[(*pos)++] << 8;
497
- return v;
495
+ uint32_t v = buf[(*pos)++];
496
+ v |= (uint32_t)buf[(*pos)++] << 8;
497
+ return (uint16_t)v;
498
498
  }
499
499
 
500
500
  static inline uint32_t bread_u24_le(const uint8_t *buf, int *pos)
@@ -546,9 +546,9 @@ static inline void bwrite_u32_le(uint32_t val, uint8_t *buf, int *len)
546
546
 
547
547
  static inline uint16_t bread_u16_be(const uint8_t *buf, int *pos)
548
548
  {
549
- uint16_t v = (uint16_t)buf[(*pos)++] << 8;
549
+ uint32_t v = (uint32_t)buf[(*pos)++] << 8;
550
550
  v |= buf[(*pos)++];
551
- return v;
551
+ return (uint16_t)v;
552
552
  }
553
553
 
554
554
  static inline uint32_t bread_u24_be(const uint8_t *buf, int *pos)
@@ -11,11 +11,11 @@
11
11
  * @brief The following macros are defined defined from the variable in cmake
12
12
  * files. All @XXX@ are replaced by the value of XXX as resolved by cmake.
13
13
  */
14
- #define PROJECT_VERSION "3.2.5"
14
+ #define PROJECT_VERSION "3.2.6"
15
15
  #define PROJECT_NAME "libosdp"
16
16
  #define GIT_BRANCH "detached"
17
- #define GIT_REV "v3.2.5-0-gdc4b8da"
18
- #define GIT_TAG "v3.2.5"
17
+ #define GIT_REV "v3.2.6-0-g9ff9013"
18
+ #define GIT_TAG "v3.2.6"
19
19
  #define GIT_DIFF ""
20
20
  #define REPO_ROOT "/home/runner/work/libosdp/libosdp"
21
21
 
@@ -473,7 +473,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
473
473
  t = OSDP_PD_CAP_RECEIVE_BUFFERSIZE;
474
474
  if (pd->cap[t].function_code == t) {
475
475
  pd->peer_rx_size = pd->cap[t].compliance_level;
476
- pd->peer_rx_size |= pd->cap[t].num_items << 8;
476
+ pd->peer_rx_size |= (uint32_t)pd->cap[t].num_items << 8;
477
477
  }
478
478
 
479
479
  /* post-capabilities hooks */
@@ -607,7 +607,7 @@ static int cp_decode_response(struct osdp_pd *pd, uint8_t *buf, int len)
607
607
  * for deprecation in v2.2.2. To avoid confusions, we will just
608
608
  * ignore it here.
609
609
  *
610
- * See: https://github.com/goToMain/libosdp/issues/206
610
+ * See: https://github.com/osdp-dev/libosdp/issues/206
611
611
  */
612
612
  LOG_WRN("Ignoring deprecated response osdp_FMT");
613
613
  ret = OSDP_CP_ERR_NONE;
@@ -52,7 +52,7 @@ void osdp_packet_capture_finish(struct osdp_pd *pd)
52
52
  LOG_ERR("Unable to stop capture (flush/close failed)");
53
53
  return;
54
54
  }
55
- LOG_INF("Captured %d packets", num_packets);
55
+ LOG_INF("Captured %zu packets", num_packets);
56
56
  }
57
57
 
58
58
  void osdp_capture_packet(struct osdp_pd *pd, uint8_t *buf, int len)
@@ -170,7 +170,7 @@ static int pd_translate_event(struct osdp_pd *pd, const struct osdp_event *event
170
170
  * osdp_FMT was underspecified by SIA from get-go. It
171
171
  * was marked for deprecation in v2.2.2.
172
172
  *
173
- * See: https://github.com/goToMain/libosdp/issues/206
173
+ * See: https://github.com/osdp-dev/libosdp/issues/206
174
174
  */
175
175
  LOG_WRN("Event CardRead::format::OSDP_CARD_FMT_ASCII"
176
176
  " is deprecated. Ignoring");
@@ -474,12 +474,14 @@ static int pd_decode_command(struct osdp_pd *pd, uint8_t *buf, int len)
474
474
  pd->reply_id = REPLY_PDCAP;
475
475
  ret = OSDP_PD_ERR_NONE;
476
476
  break;
477
- case CMD_OUT:
477
+ case CMD_OUT: {
478
+ int count;
478
479
  if ((len % CMD_OUT_DATA_LEN) != 0) {
479
480
  break;
480
481
  }
482
+ count = len / CMD_OUT_DATA_LEN;
481
483
  ret = OSDP_PD_ERR_REPLY;
482
- for (i = 0; i < len / CMD_OUT_DATA_LEN; i++) {
484
+ for (i = 0; i < count; i++) {
483
485
  cmd.id = OSDP_CMD_OUTPUT;
484
486
  cmd.output.output_no = buf[pos++];
485
487
  cmd.output.control_code = buf[pos++];
@@ -491,15 +493,20 @@ static int pd_decode_command(struct osdp_pd *pd, uint8_t *buf, int len)
491
493
  break;
492
494
  }
493
495
  }
494
- pd->reply_id = REPLY_ACK;
495
- ret = OSDP_PD_ERR_NONE;
496
+ if (i == count) {
497
+ pd->reply_id = REPLY_ACK;
498
+ ret = OSDP_PD_ERR_NONE;
499
+ }
496
500
  break;
497
- case CMD_LED:
501
+ }
502
+ case CMD_LED: {
503
+ int count;
498
504
  if ((len % CMD_LED_DATA_LEN) != 0) {
499
505
  break;
500
506
  }
507
+ count = len / CMD_LED_DATA_LEN;
501
508
  ret = OSDP_PD_ERR_REPLY;
502
- for (i = 0; i < len / CMD_LED_DATA_LEN; i++) {
509
+ for (i = 0; i < count; i++) {
503
510
  cmd.id = OSDP_CMD_LED;
504
511
  cmd.led.reader = buf[pos++];
505
512
  cmd.led.led_number = buf[pos++];
@@ -523,15 +530,20 @@ static int pd_decode_command(struct osdp_pd *pd, uint8_t *buf, int len)
523
530
  break;
524
531
  }
525
532
  }
526
- pd->reply_id = REPLY_ACK;
527
- ret = OSDP_PD_ERR_NONE;
533
+ if (i == count) {
534
+ pd->reply_id = REPLY_ACK;
535
+ ret = OSDP_PD_ERR_NONE;
536
+ }
528
537
  break;
529
- case CMD_BUZ:
538
+ }
539
+ case CMD_BUZ: {
540
+ int count;
530
541
  if ((len % CMD_BUZ_DATA_LEN) != 0) {
531
542
  break;
532
543
  }
544
+ count = len / CMD_BUZ_DATA_LEN;
533
545
  ret = OSDP_PD_ERR_REPLY;
534
- for (i = 0; i < len / CMD_BUZ_DATA_LEN; i++) {
546
+ for (i = 0; i < count; i++) {
535
547
  cmd.id = OSDP_CMD_BUZZER;
536
548
  cmd.buzzer.reader = buf[pos++];
537
549
  cmd.buzzer.control_code = buf[pos++];
@@ -545,9 +557,12 @@ static int pd_decode_command(struct osdp_pd *pd, uint8_t *buf, int len)
545
557
  break;
546
558
  }
547
559
  }
548
- pd->reply_id = REPLY_ACK;
549
- ret = OSDP_PD_ERR_NONE;
560
+ if (i == count) {
561
+ pd->reply_id = REPLY_ACK;
562
+ ret = OSDP_PD_ERR_NONE;
563
+ }
550
564
  break;
565
+ }
551
566
  case CMD_TEXT:
552
567
  if (len < CMD_TEXT_DATA_LEN) {
553
568
  break;
@@ -421,7 +421,7 @@ static int phy_validate_header(struct osdp_pd *pd, uint8_t *buf,
421
421
  return OSDP_ERR_PKT_FMT;
422
422
  }
423
423
 
424
- pkt_len = (pkt->len_msb << 8) | pkt->len_lsb;
424
+ pkt_len = ((uint32_t)pkt->len_msb << 8) | pkt->len_lsb;
425
425
  if (pkt_len > max_len ||
426
426
  pkt_len < sizeof(struct osdp_packet_header) + 1 ||
427
427
  (is_cp_mode(pd) && !(pkt->pd_address & 0x80)) ||
@@ -540,7 +540,7 @@ static int phy_check_packet(struct osdp_pd *pd, uint8_t *buf, int pkt_len)
540
540
  /* validate CRC/checksum */
541
541
  if (pkt->control & PKT_CONTROL_CRC) {
542
542
  pkt_len -= 2; /* consume CRC */
543
- cur = (buf[pkt_len + 1] << 8) | buf[pkt_len];
543
+ cur = ((uint32_t)buf[pkt_len + 1] << 8) | buf[pkt_len];
544
544
  comp = osdp_compute_crc16(buf, pkt_len);
545
545
  if (comp != cur) {
546
546
  LOG_ERR("Invalid crc 0x%04x/0x%04x", comp, cur);
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes