diff options
author | Jouni Malinen <jouni@qca.qualcomm.com> | 2013-11-29 11:01:39 (GMT) |
---|---|---|
committer | Jouni Malinen <j@w1.fi> | 2014-01-27 20:08:14 (GMT) |
commit | 12288d848c9a507cfa834cbda1eec0bef7c53b5a (patch) | |
tree | 37f342a108264bc590010f38b533faa21b69c594 /hostapd/wps-ap-nfc.py | |
parent | c209dd11080de6defb048450fe0474dcf70d10ca (diff) | |
download | hostap-12288d848c9a507cfa834cbda1eec0bef7c53b5a.zip hostap-12288d848c9a507cfa834cbda1eec0bef7c53b5a.tar.gz hostap-12288d848c9a507cfa834cbda1eec0bef7c53b5a.tar.bz2 |
WPS NFC: Protect nfcpy pretty print calls against exceptions
nfcpy does not yet support all the new message formats, so some of the
pretty() calls can result in exceptions.
Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/wps-ap-nfc.py')
-rwxr-xr-x | hostapd/wps-ap-nfc.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/hostapd/wps-ap-nfc.py b/hostapd/wps-ap-nfc.py index b9e233e..58e538a 100755 --- a/hostapd/wps-ap-nfc.py +++ b/hostapd/wps-ap-nfc.py @@ -92,7 +92,11 @@ class HandoverServer(nfc.handover.HandoverServer): def process_request(self, request): print "HandoverServer - request received" - print "Parsed handover request: " + request.pretty() + try: + print "Parsed handover request: " + request.pretty() + except Exception, e: + print e + print str(request).encode("hex") sel = nfc.ndef.HandoverSelectMessage(version="1.2") @@ -112,7 +116,10 @@ class HandoverServer(nfc.handover.HandoverServer): sel.add_carrier(message[0], "active", message[1:]) print "Handover select:" - print sel.pretty() + try: + print sel.pretty() + except Exception, e: + print e print str(sel).encode("hex") print "Sending handover select" |