sec51 / twofactor

Golang two factor authentication library
ISC License
217 stars 66 forks source link

Cannot make library write the keys files. #20

Open nugget opened 6 years ago

nugget commented 6 years ago

I've been using this library for several years now and with the recent builds I'm seeing a strange change in behavior where it is not writing out any contents to the keys directory under normal operation.

If I have a populated keys directory the saved keypair, secret, and salt are loaded as I'd expect.

If I launch my application with no saved keys, the keys directory is created, but no files are placed inside.

What behavior triggers the key files to be written? I thought it was supposed to happen when I called NewTOTP() but that doesn't seem to be the case. I could swear that's how it used to behave, though.

Is this a bug or am I doing something wrong?