imgtool: prefer cbor2 over cbor

The cbor module is unmaintained, with the last release in 2016[1]. The
cbor2 module however is under active development and was last released
just last month[2].

As the APIs are identical, we can import cbor2 and if that fails fall
back to cbor.

[1] https://pypi.org/project/cbor/#history
[2] https://pypi.org/project/cbor2/#history

Closes #1189

Signed-off-by: Ross Burton <ross.burton@arm.com>
Change-Id: Iaf2d0df625a200a5cebf72dec4a89877a26194ea
diff --git a/scripts/setup.py b/scripts/setup.py
index a228ea3..692cfb7 100644
--- a/scripts/setup.py
+++ b/scripts/setup.py
@@ -17,7 +17,7 @@
         'cryptography>=2.4.2',
         'intelhex>=2.2.1',
         'click',
-        'cbor>=1.0.0',
+        'cbor2',
     ],
     entry_points={
         "console_scripts": ["imgtool=imgtool.main:imgtool"]