Make passport_application work with windows
git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@191 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
parent
47662ab48e
commit
758223149b
|
@ -1,5 +1,5 @@
|
||||||
from generic_application import Application
|
from generic_application import Application
|
||||||
import struct, sha, binascii
|
import struct, sha, binascii, os
|
||||||
from utils import hexdump, C_APDU
|
from utils import hexdump, C_APDU
|
||||||
from tcos_card import SE_Config, TCOS_Security_Environment
|
from tcos_card import SE_Config, TCOS_Security_Environment
|
||||||
from generic_card import Card
|
from generic_card import Card
|
||||||
|
@ -220,13 +220,8 @@ class Passport_Application(Application):
|
||||||
_mac = staticmethod(_mac)
|
_mac = staticmethod(_mac)
|
||||||
|
|
||||||
def _make_random(len):
|
def _make_random(len):
|
||||||
"Get len random bytes from /dev/urandom"
|
"Get len random bytes"
|
||||||
urand = file("/dev/urandom","r")
|
return os.urandom(len)
|
||||||
try:
|
|
||||||
r = urand.read(len)
|
|
||||||
finally:
|
|
||||||
urand.close()
|
|
||||||
return r
|
|
||||||
_make_random = staticmethod(_make_random)
|
_make_random = staticmethod(_make_random)
|
||||||
|
|
||||||
def get_prompt(self):
|
def get_prompt(self):
|
||||||
|
|
Loading…
Reference in New Issue