On Thu, Dec 28, 2006 at 03:13:30PM +0100, Peter Koch wrote:
> Unfortunately the login-process uses some sort of challenge-response
> mechanism (GET CHALLENGE command followed by EXTERNAL AUTH)
> So far I have absolutely no idea how to compute the response from
> a given challenge. I do know where the certs and keys are, and I do
> know all APDUs that are necessary. So the response-computation
> is the only missing information.

External auth operates against a special test object
(called a C/R TEST object in the docs). The algorithm used
can be one of MAC, MAC3, iMAC, iMAC3.

iMAC and MAC differ in the padding method they use (ISO vs ANSI).
MAC is essentially 3 rounds of ECB DES with the same key:

        Step1 = DES_encrypt(KeyA, Input XOR IV)
        Step2 = DES_encrypt(KeyA, Input XOR Step1);
        MAC   = DES_encrypt(KeyA, Input XOR Step2);

MAC3 adds two more ECB encryption steps using KeyB, KeyC:

        Step3 = DES_decrypt(KeyB, MAC)
        MAC3  = DES_encrypt(KeyC, Step3)

The input is the (padded) challenge retrived previously.

Which of these you really need depends on the BS object the access
condition uses.

Which still doesn't answer how to derive the keys, of
course. And I'm afraid the only thing that helps here is asking
Aladdin, or reverse engineering the code (but then you can't
code the driver anymore, for legal reasons - you really need
to take a clean room approach to be on the safe side).

Olaf
-- 
Olaf Kirch   |  --- o --- Nous sommes du soleil we love when we play
[EMAIL PROTECTED] |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax
_______________________________________________
opensc-devel mailing list
opensc-devel@lists.opensc-project.org
http://www.opensc-project.org/mailman/listinfo/opensc-devel

Reply via email to