NXP Reader Library : phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

NXP Reader Library : phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry

4,400 次查看
frederic_surleau
Contributor II

Hi,

When the function phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry(), is called to change the actual authentication host key, authentication is no longer valid.

So, in this case, pDataParams->bAuthType should be reset to 0x00.

It is not.

Same problem with phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntry()...

0 项奖励
回复
12 回复数

4,372 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

I would like to clarify your question. So, what kind of environment do you work in, what kind of reader do you use, and what kind of card do you operate? It will be convenient for me to repeat your question.

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

Best regards,
Kelly
Technical Support
NXP Semiconductor

0 项奖励
回复

4,368 次查看
frederic_surleau
Contributor II

Hi, I use a PC/SC reader to personalize SAM AV2 / AV3 via a windows software I wrote using NXP Reader Library.

The SAM will then be used to authenticate Mifare DESFire EV1 cards.

In the process of personalizing the SAM, I need the change Key Entries, for example, the entry n°0 as host / unlock key.

  1. Call phhalHw_SamAV2_Cmd_SAM_GetKeyEntry to determine key type and key versions
  2. Authenticate with default key with authType 0x02 to encipher host channel.
  3. Call phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry to change entry.
  4. Call phhalHw_SamAV2_Cmd_SAM_GetKeyEntry to check all is OK.

After step 3, the Host is no longer authenticated with entry 0 because the key changed.

So for Step 4 to succed, I need to force pDataParams->bAuthType to 0x00 (plain).

Thats not a big deal to do, but it was confusing to no be able to use phhalHw_SamAV2_Cmd_SAM_GetKeyEntry. This function is supposed to be available at any time.

So I imagine that phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry could reset AuthType in case the authentication is invalidated.

Regards,

Fred.

 

0 项奖励
回复

4,211 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

For the below issues, I have received reply from the internal experts. The following is from expert suggestions:

There is the KillAuthentication command, which will invalidate all authentications, or only the PICC Auth (P1 param)

simply inject that one between 3 and 4, that is the correct solution, and will bring the dataparams in a defined state.

Hope the above reply could help you.

 

Hi, I use a PC/SC reader to personalize SAM AV2 / AV3 via a windows software I wrote using NXP Reader Library.

The SAM will then be used to authenticate Mifare DESFire EV1 cards.

In the process of personalizing the SAM, I need the change Key Entries, for example, the entry n°0 as host / unlock key.

  1. Call phhalHw_SamAV2_Cmd_SAM_GetKeyEntry to determine key type and key versions
  2. Authenticate with default key with authType 0x02 to encipher host channel.
  3. Call phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry to change entry.
  4. Call phhalHw_SamAV2_Cmd_SAM_GetKeyEntry to check all is OK.

After step 3, the Host is no longer authenticated with entry 0 because the key changed.

So for Step 4 to succed, I need to force pDataParams->bAuthType to 0x00 (plain).

Thats not a big deal to do, but it was confusing to no be able to use phhalHw_SamAV2_Cmd_SAM_GetKeyEntry. This function is supposed to be available at any time.

So I imagine that phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry could reset AuthType in case the authentication is invalidated.

Regards,

Fred.

0 项奖励
回复

4,355 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

There is an example for how to authentication MIFARE DESFire EV2/EV1 by SAM. But as you may know, this is a secure product, and its document requires an NDA. If you already have one, please let me know so I can orient you to find the documents which can help you solve your issue. In case you need to sign an NDA, please let me know if you need.

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

Best regards,
Kelly
Technical Support
NXP Semiconductor

0 项奖励
回复

4,283 次查看
frederic_surleau
Contributor II

Hi,

We have already signed a NDA, and have all documentation needed.

The problem is not authenticating a SAM with a MIFARE DESFire. I wrote about DESFire to answer your question about the type of card we use.

The problem is before, when I use the library to put keys in the SAM : After changing a HOST key, the authentication with that key is no longer valid, and the the parameter bAuthType should be reset to 0x00, which I think the function "phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry" should do.

Regards.

0 项奖励
回复

4,276 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

If you already have NDA, and then please download sw733910 package from https://www.docstore.nxp.com

And if you have any issue for download or doc store account issue, please contact support.docstore@nxp.com for further support.

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

Best regards,
Kelly
Technical Support
NXP Semiconductor

0 项奖励
回复

4,266 次查看
frederic_surleau
Contributor II

Ok, I do not find it.

In which category should I look ?

Is it an upgrade of sw171756, the subject of this topic ?

Regards.

0 项奖励
回复

4,262 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

The fact that you cannot see this file means you don't have permission yet, please contact support.docstore@nxp.com for further support.

 

NXF92074_0-1673251524232.png

 

 

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

 

Best regards,

Kelly

Technical Support

NXP Semiconductor

 

0 项奖励
回复

4,246 次查看
frederic_surleau
Contributor II

Hi,

I downloaded SW7339 PN7462 MIFARE DESFire and MIFARE SAM AV3 v07.02.00 NDA v01.00.

I found "phhalHw_SamAV2_Cmd_SAM_ChangeKeyEntry()" in NxpNfcRdLib\comps\phhalHw\src\SamAV2\phhalHw_SamAV2_Cmd.c

It is exactly the same code as the one in NxpRdLib (sw171756), so I don't see the point...

As I said in my first post, it is not a BIG problem. I was just suggesting to do a little modification.

Regards,

Fred.

0 项奖励
回复

4,234 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

This example sw733910\Examples\NfcrdlibEx10_MIFAREDESFire_Evx is using SAM to authenticate Mifare DESFire EVx cards base on PN7462 Reader. Please try to follow the steps in this example to implement your application.

 

Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.

Best regards,

Kelly

Technical Support

NXP Semiconductor

0 项奖励
回复

4,231 次查看
frederic_surleau
Contributor II

Ok, you really misunderstood my problem.

Bye.

0 项奖励
回复

4,218 次查看
KaiLi
NXP TechSupport
NXP TechSupport

Hello @frederic_surleau 

I don't misunderstand your question, I mean your ultimate goal is achieved by this example, I don't have these devices on my side and to debug, so I suggest you follow this example to achieve your goal. Anyway, your question has been forwarded to the internal expert of NXP and I'll keep update you. Please understand the inconvenience.

 

Thank you for your interest in NXP Semiconductor products andfor the opportunity to serve you.

Best regards,

Kelly

Technical Support

NXP Semiconductor

0 项奖励
回复