cablelabs / micronets-gw

Micronets Gateway Daemon and Distribution #micronets
Other
2 stars 1 forks source link

Add support for AP key registration using registration tokens (Issue #49, #57) #56

Closed craigpratt closed 3 years ago

craigpratt commented 3 years ago

This adds support for one-time registration of the AP's public key via use of an AP registration token.

If a file called "netreach-reg-token.txt" exists in the agent's "lib" directory, the AP will call the NetReach controller to register the AP using the registration token and the AP's serial number. The controller will only allow the pubkey to be registered if (a) the registration token is valid and verified, (b) the serial number of the AP matches the one associated with the token. As these tokens are one-time use, the AP will delete the registration token file once it's registered the public key. Note that the logic will also generate the pub/priv keypair if they don't already exist (in the files "netreach-pubkey.pem" and "netreach-privkey.pem").