Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add input validation for ICAO-IDs #5

Open
kerel-fs opened this issue Dec 1, 2015 · 1 comment
Open

Add input validation for ICAO-IDs #5

kerel-fs opened this issue Dec 1, 2015 · 1 comment

Comments

@kerel-fs
Copy link
Contributor

kerel-fs commented Dec 1, 2015

We should add input validation for ICAO-IDs.

Why?
According to http://www.kloth.net/radio/icao24alloc.php,

[...] addresses starting with bit combinations
1011, 1101 and 1111 have been reserved for future use.

Unfortunately, there are DDB entries of type 'I' with an address from the reserved range.
Test script:

#!/usr/bin/env python3
from ogn.utils import get_ddb

ddb = {}
for d in get_ddb():
  id = int(d.address, 16)
  ddb.update({id: d})

i = 0
for d in ddb:
  # ICAO-Address in 'reserved for further use'-range
  if ddb[d].address_type == 'I' and bin(d)[2:6] in ['1011','1101','1111']:
    print('{}{}'.format(bin(d), ddb[d]))
    i += 1
print("%i entries" % i)
# current Result: '102 entries'
@kerel-fs
Copy link
Contributor Author

Some time ago, gewesp mentioned the same issue on the ML: ID types in DDB (login required...)
@gewesp: Do you know the range of valid 24bit-addresses for flarm devices (factory settings)?

RfC: Add validation for newly entered addresses.
For I-device_type addresses, either disallow addresses starting with B16 (1011), D16 (1101) and F16 (1111) or explicitely whitelist the respective ranges defined by ICAO Annex 10 Volume III - Chapter 9. Aircraft Addressing System.

ID type disallowed
I all addresses starting with B16, D16 and F16
F tbd, guessing addresses starting with DD16 and others
O nothing (but recommend addresses starting with B16, D16 and F16)

Or should we drop the device_type since it's data is wrong and thus useless?
(increasing the probability of collisions duplicates)

Edit:
Replaced "collisions" by "duplicates", since it has a double meaning in this context. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants