Skip to content

Command atcab_sha_hmac_init is failed with status 0xf4 #8

@rrottmann

Description

@rrottmann

I'm trying to generate a hmac digest. I am using slot 6 for this which is configured like this:

=========================  Slot: 6   ==================
Decoding SlotConfig value = 0x0F8F
Read key (except ECC private keys): 15
 If slot contains ECC private keys:
  External signatures of arbitrary messages are enabled: 1
  Internal signatures are enabled: 1
  ECDH operation is permitted for this key: 1
   ECDH master secret output mode: 1
NoMac bit: 0
LimitedUse bit: 0
EncryptRead bit: 0
IsSecret bit: 1
Write key: 15
Write config: 0x0 (hex) = 0000 (bin)
  Write cmd: Always
  DeriveKey cmd: Can't be used
  GenKey cmd: may NOT be used
  PrivWrite cmd: Forbidden
-------------
Decoding KeyConfig value = 0x007C
Private bit: 0
PubInfo bit: 0
KeyType: 7 [SHA or other]
Lockable bit: 1
ReqRandom bit: 1
ReqAuth bit: 0
AuthKey: 0
IntrusionDisable bit: 0
X509id: 0

The configuration zone is locked and I can interact with the i2c device.

Then I create a random key:

head -c 16 /dev/urandom > hmac.key

I can write the key (works only with less than 32 bytes):

atecc -b1 -c "hmac-write-key 6 0 hmac.key"
read key from file: Success

Then I try to digest a message:

echo "This is a test" > message
touch hmac.digest
# Usage: hmac-dgst <slot_id> <payload_file> <hmac_output>
atecc -b1 -c "hmac-dgst 6 message hmac.digest"
Command atcab_sha_hmac_init is failed with status 0xf4

Do I miss something? Is it necessary to lock the slot 6 before calculating the hmac? Is KeyType 7 [SHA or other] correct?

Thanks in advance for any pointers to get more familiar with atecc-util!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions