release 0.1.1

* fix password protection bug
This commit is contained in:
tom 2014-04-25 10:35:03 +02:00
parent 00401d7f02
commit ac2878c6de
4 changed files with 12 additions and 5 deletions

View File

@ -13,4 +13,4 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
__version__ = "0.1.0"
__version__ = "0.1.1"

View File

@ -87,11 +87,13 @@ def open_key(name=None):
def open_key_multiple_readers(name=None):
"""
Opens a smartcard reader matching the given name and connects to the
ykneo-bitcoin applet through it.
ykneo-oath applet through it.
Returns a reference to the YkneoYubiOath object.
"""
for reader in readers():
print "list of readers"
print readers
try:
conn = reader.createConnection()
conn.connect()
@ -102,9 +104,13 @@ def open_key_multiple_readers(name=None):
if (status) != 0x9000:
print "unable to select the applet on reader %s" % reader
else:
print "using reader"
print reader
return YkneoYubiOath(conn)
except Exception, e:
print "WARNING: %s" % e
print "i am in the except of multiple readers"
raise Exception('No smartcard reader found with YubiOath applet')

View File

@ -1,4 +1,4 @@
version = "0.1.0"
version = "0.1.1"
copyright = """

View File

@ -223,14 +223,15 @@ def unlock_applet(neo, password):
install_id = functions.get_id(neo) #get id
challenge = functions.get_challenge(neo) #get challenge
key = PBKDF2(password, install_id).read(16)
response = hmac.new(key, challenge, hashlib.sha1).digest()
cmd = commands['unlock']
payload = functions.unlock_payload(response)
try:
result = neo._cmd_ok(cmd['cl'], cmd['ins'], cmd['p1'], cmd['p2'], payload)
result = neo._cmd_ok(cmd['cl'], cmd['ins'], cmd['p1'], cmd['p2'], payload)
neo.password_protected = False
return True
except Exception, e:
#set the NEO to none as we will need to check for password again