Yubico / ykneo-oath

OATH App for the YubiKey NEO
https://developers.yubico.com/ykneo-oath/
GNU General Public License v3.0
63 stars 40 forks source link

Use transactions when changing non-volatile state #18

Closed darconeous closed 4 years ago

darconeous commented 4 years ago

While the JC runtime will guarantee that almost all operations will be performed atomically, this guarantee is only made for individual operations. For example, if a tear occurs while the linked list is being updated, then the list state may become inconsistent and objects may be lost.

This change makes sure that we wrap all high-level commands that change non-volatile state in a transaction. This ensures that tearing won't leave the applet in a bad state.

This change also converts two instances of arrayCopy into their non-atomic counterpart, since there is no benefit to them being atomic.

darconeous commented 4 years ago

The travis failure seems unrelated.

klali commented 4 years ago

Thanks!

Merging.