nPA: updated CLI information regarding CAR

This commit is contained in:
Frank Morgner
2012-10-04 11:39:32 +02:00
parent 25b75d7ffe
commit 203f4ac5b2
3 changed files with 11 additions and 11 deletions

View File

@@ -73,10 +73,10 @@ npa.add_argument("-k", "--ca-key",
action="store",
type=argparse.FileType('rb'),
help="CA private key.")
npa.add_argument("-c", "--ca",
npa.add_argument("-c", "--car",
action="store",
type=str,
help="CHR of the CVCA.")
help="certificate authority reference (CHR of the CVCA)")
npa.add_argument("-d", "--disable-checks",
action="store_true", default=False,
help="Disable checking validity period of TA certificate")
@@ -102,5 +102,5 @@ if (args.ca_key):
vicc = VirtualICC(args.file, args.type,
args.hostname, args.port, readernum=args.reader,
ef_cardaccess=ef_cardaccess_data, ef_cardsecurity=ef_cardsecurity_data,
ca_key=ca_key_data, ca=args.ca, disable_checks=args.disable_checks)
ca_key=ca_key_data, car=args.car, disable_checks=args.disable_checks)
vicc.run()

View File

@@ -499,7 +499,7 @@ class RelayOS(SmartcardOS):
class NPAOS(Iso7816OS):
def __init__(self, mf, sam, ins2handler=None, maxle=MAX_EXTENDED_LE, ef_cardsecurity=None, ef_cardaccess=None, ca_key=None, ca=None, disable_checks=False):
def __init__(self, mf, sam, ins2handler=None, maxle=MAX_EXTENDED_LE, ef_cardsecurity=None, ef_cardaccess=None, ca_key=None, car=None, disable_checks=False):
Iso7816OS.__init__(self, mf, sam, ins2handler, maxle)
self.ins2handler[0x86] = self.SAM.general_authenticate
self.ins2handler[0x2c] = self.SAM.reset_retry_counter
@@ -511,8 +511,8 @@ class NPAOS(Iso7816OS):
if ef_cardaccess:
ef = self.mf.select('fid', 0x011c)
ef.data = ef_cardaccess
if ca:
self.SAM.current_SE.ca = ca
if car:
self.SAM.current_SE.car = car
if ca_key:
self.SAM.current_SE.ca_key = ca_key
@@ -555,7 +555,7 @@ class VirtualICC(object):
the vpcd, which forwards it to the application.
"""
def __init__(self, filename, card_type, host, port, lenlen=3, readernum=None, ef_cardsecurity=None, ef_cardaccess=None, ca_key=None, ca=None, disable_checks=False):
def __init__(self, filename, card_type, host, port, lenlen=3, readernum=None, ef_cardsecurity=None, ef_cardaccess=None, ca_key=None, car=None, disable_checks=False):
from os.path import exists
logging.basicConfig(level = logging.INFO,
@@ -580,7 +580,7 @@ class VirtualICC(object):
if card_type == "iso7816" or card_type == "ePass":
self.os = Iso7816OS(MF, SAM)
elif card_type == "nPA":
self.os = NPAOS(MF, SAM, ef_cardsecurity=ef_cardsecurity, ef_cardaccess=ef_cardaccess, ca_key=ca_key, ca=ca, disable_checks=disable_checks)
self.os = NPAOS(MF, SAM, ef_cardsecurity=ef_cardsecurity, ef_cardaccess=ef_cardaccess, ca_key=ca_key, car=car, disable_checks=disable_checks)
elif card_type == "cryptoflex":
self.os = CryptoflexOS(MF, SAM)
elif card_type == "relay":

View File

@@ -106,7 +106,7 @@ class nPA_SE(Security_Environment):
self.sec = None
self.eac_ctx = None
self.ssc = 0
self.ca = "DECVCAeID00102"
self.car = "DECVCAeID00102"
self.ca_key = None
self.disable_checks = False
@@ -301,11 +301,11 @@ class nPA_SE(Security_Environment):
result = [[0x86, len(my_token), my_token]]
if self.at.chat:
result.append([0x87, len(self.ca), self.ca])
result.append([0x87, len(self.car), self.car])
if (self.disable_checks):
pace.TA_disable_checks(self.eac_ctx)
else:
if not pace.EAC_CTX_init_ta(self.eac_ctx, None, None, self.ca):
if not pace.EAC_CTX_init_ta(self.eac_ctx, None, None, self.car):
pace.print_ossl_err()
raise SwError(SW["WARN_NOINFO63"])