[OpenTRV-dev] AES-GCM protected secure frames implemented

Damon Hart-Davis dhd at exnet.com
Wed Jan 13 08:15:03 GMT 2016


> Anyone who wishes to inspect and critique and review the implementation in OTRadioLink and OTAESGCM and the spec please do, and I’ll be happy to guide you through it as necessary.  There is always more that could be done, but it has to be robust and reliable as it stands, eg no buffer overflow possible even on maliciously-constructed received frames.

Hi,

Well, I was actually asked for the code locations, so I copy the relevant part of the email below!

Also, a reminder of one way to get to the currennt spec:

https://github.com/DamonHD/OpenTRV/blob/master/standards/protocol/IoTCommsFrameFormat/SecureBasicFrame-V0.1-201601.txt

-------

The code is in two libraries:

The OTAESGCM library contains the base AES-GCM code plus some wrappers, and some unit tests including against NIST test vectors.

https://github.com/opentrv/OTAESGCM

The wrapping into secure frames as per the spec (though not all beautiful yet) is in the OTRadioLink library:

https://github.com/opentrv/OTRadioLink

and specifically in these header and implementation files:

https://github.com/opentrv/OTRadioLink/blob/master/content/OTRadioLink/utility/OTRadioLink_SecureableFrameType.h
https://github.com/opentrv/OTRadioLink/blob/master/content/OTRadioLink/utility/OTRadioLink_SecureableFrameType.cpp

and with this unit test set:

https://github.com/opentrv/OTRadioLink/blob/master/test_SECFRAME/test_SECFRAME.ino

We have cross tested against a Java reference implementation (in tests) to catch some implementation tests and to work against a known-good AES-GCM implementation.

https://github.com/DamonHD/OpenTRV/tree/master/javasrc/uk/org/opentrv/test/leafauthenc

All this needs tidying up, more documentation, etc, etc, but I think that the core is robust and complete.

Rgds

Damon




More information about the OpenTRV-dev mailing list