version 0.20

This commit is contained in:
NIIBE Yutaka
2012-06-19 10:19:26 +09:00
parent cb8ee10292
commit b3c15ce93c
9 changed files with 46 additions and 38 deletions

View File

@@ -94,7 +94,7 @@ STATE_DFU_ERROR = 0x0a
def get_four_bytes (v):
return [ v % 256, (v >> 8)%256, (v >> 16)%256, (v >> 24) ]
class DFU_STM32:
class DFU_STM32(object):
def __init__(self, device, configuration, interface):
"""
__init__(device, configuration, interface) -> None

View File

@@ -2,7 +2,7 @@
"""
gnuk_put_binary.py - a tool to put binary to Gnuk Token
This tool is for importing certificate, updating random number, etc.
This tool is for importing certificate, writing serial number, etc.
Copyright (C) 2011, 2012 Free Software Initiative of Japan
Author: NIIBE Yutaka <gniibe@fsij.org>

View File

@@ -2,7 +2,7 @@
"""
gnuk_put_binary.py - a tool to put binary to Gnuk Token
This tool is for importing certificate, updating random number, etc.
This tool is for importing certificate, writing serial number, etc.
Copyright (C) 2011, 2012 Free Software Initiative of Japan
Author: NIIBE Yutaka <gniibe@fsij.org>
@@ -23,7 +23,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from intel_hex import *
from struct import *
import sys, time, os, binascii, string
@@ -49,7 +48,7 @@ def iso7816_compose(ins, p1, p2, data, cls=0x00):
return pack('>BBBBB', cls, ins, p1, p2, data_len) + data
# This class only supports Gnuk (for now)
class gnuk_token:
class gnuk_token(object):
def __init__(self, device, configuration, interface):
"""
__init__(device, configuration, interface) -> None

View File

@@ -22,7 +22,6 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
"""
from intel_hex import *
from struct import *
import sys, time, os, binascii, string
@@ -47,7 +46,7 @@ def iso7816_compose(ins, p1, p2, data, cls=0x00):
else:
return pack('>BBBBB', cls, ins, p1, p2, data_len) + data
class regnual:
class regnual(object):
def __init__(self, dev):
conf = dev.configurations[0]
intf_alt = conf.interfaces[0]
@@ -154,7 +153,7 @@ class regnual:
pass
# This class only supports Gnuk (for now)
class gnuk_token:
class gnuk_token(object):
def __init__(self, device, configuration, interface):
"""
__init__(device, configuration, interface) -> None

View File

@@ -9,7 +9,7 @@ You can use/distribute/modify/etc. this for any purpose.
import binascii
class intel_hex:
class intel_hex(object):
def __init__(self, filename):
self.start_address = 0
self.address = 0