From 7c3f71f4530aa2c766741c762558bf71a6ee68ca Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Fri, 12 Jan 2007 20:47:52 +0000 Subject: [PATCH] Handle devices without UUID. Disable one time pads if so --- tools/pusb_conf | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/pusb_conf b/tools/pusb_conf index c12c2f7..abc545e 100755 --- a/tools/pusb_conf +++ b/tools/pusb_conf @@ -106,7 +106,11 @@ def addDevice(options): print 'Vendor\t\t: %s' % device.vendor print 'Model\t\t: %s' % device.product print 'Serial\t\t: %s' % device.serialNumber - print 'Volume UUID\t: %s (%s)' % (volume['uuid'], volume['device']) + if volume['uuid'] != '': + print 'Volume UUID\t: %s (%s)' % (volume['uuid'], volume['device']) + else: + print + print 'WARNING: No UUID detected for device %s. One time pads will be disabled.' % volume['device'] print print 'Save device to %s ?' % options['configFile'] @@ -134,6 +138,13 @@ def addDevice(options): e.appendChild(t) dev.appendChild(e) + # Disable one time pads if there's no device UUID + if volume['uuid'] == '': + e = doc.createElement('option') + e.setAttribute('name', 'one_time_pad') + e.appendChild(doc.createTextNode('false')) + dev.appendChild(e) + try: f = open(options['configFile'], 'w') f.write(doc.toxml())