cr50: Support legacy U2F key handles

The new U2F functions make use of a new key derivation
scheme. This adds a flag clients can specify that
allows the new functions to also sign requests
using a legacy key handle. This will allow continued
support of legacy key handles in Chrome OS whilst
allowing the legacy code to be removed from cr50.

BUG=b:112603199, b:123161715
TEST=with new cr50 and u2fd patched to send new param:
     - register legacy key handle with Google
     - restart u2fd with user keys and no fallback
     - check login fails
     - restart u2fd with user keys and fallback
     - check login succeeds

Signed-off-by: Louis Collard <louiscollard@chromium.org>
Change-Id: Ib3164e9c0856d51b958fa8db181153b5b2227850
Reviewed-on: https://chromium-review.googlesource.com/1580622
Reviewed-by: Andrey Pronin <apronin@chromium.org>
2 files changed