Generate an Base Derivation Key (*BDK) command's error

Dec 8, 2010 at 8:52 AM
Edited Dec 8, 2010 at 9:34 AM

Hi Nickntg,

I have tried the BI (BJ) command:

Sent to HSM: 1234BI;UU1

Response from HSM: 1234BJ26

Error Code 26: Invalid key scheme

In the HSM 8000 Host Command Reference Manual document it only return 00, 13 and 15.

00 : No errors
13 : LMK error; report to supervisor
15 : Error in input data

This is the Application Events:

Client from 127.0.0.1:52378 is connected
Client: 127.0.0.1:52378
Request: 1234BI;UU1
Parsing header and code of message 1234BI;UU1...
Searching for implementor of BI...
Found implementor ThalesSim.Core.HostCommands.BuildIn.GenerateBDK_BI, instantiating...
Calling AcceptMessage()...
Calling ConstructResponse()...
Calling ConstructResponseAfterOperationComplete()...
Attaching header/response code to response...
Sending: 1234BJ26
Calling Terminate()...
Implementor to Nothing
Client disconnected.

And this is Command Events:

=== [BI], starts 16:49:48.366 =======
[Key,Value]=[Delimiter,;]
[Key,Value]=[Reserved,U]

=== [BI],   ends 16:49:48.372 =======

Please check agian this command and the error code.

Thank you!

Coordinator
Dec 8, 2010 at 10:17 AM
kiendt85 wrote:In the HSM 8000 Host Command Reference Manual document it only return 00, 13 and 15.

00 : No errors
13 : LMK error; report to supervisor
15 : Error in input data

Or a standard error code, as listed in Chapter 4. The problem is that the command doesn't like the key scheme. That is because there of an omission in the XML definition file which is GenerateBDK_BI.xml. You can fix that very quickly by changing the contents from:

<?xml version="1.0" encoding="utf-8" ?>
<CommandConfiguration xmlns="http://tempuri.org/HostCommandDefinitions.xsd">
  <CommandName>Generates a random BDK.</CommandName>
  <Request>BI</Request>
  <Response>BJ</Response>

  <Field>
    <Name>Delimiter</Name>
    <Length>1</Length>
    <Type>Character</Type>
    <ValidValue>;</ValidValue>
  </Field>

  <Field>
    <Name>Reserved</Name>
    <Length>1</Length>
    <Type>Character</Type>
    <DependentField>Delimiter</DependentField>
    <DependentValue>;</DependentValue>
  </Field>

  <Field>
    <Name>Key Scheme LMK</Name>
    <Length>1</Length>
    <Type>Character</Type>
    <DependentField>Delimiter</DependentField>
    <DependentValue>;</DependentValue>
  </Field>

  <Field>
    <Name>Reserved 2</Name>
    <Length>1</Length>
    <Type>Character</Type>
    <DependentField>Delimiter</DependentField>
    <DependentValue>;</DependentValue>
  </Field>

</CommandConfiguration> 

to the correct:

<?xml version="1.0" encoding="utf-8" ?>
<CommandConfiguration xmlns="http://tempuri.org/HostCommandDefinitions.xsd">
<CommandName>Generates a random BDK.</CommandName>
<Request>BI</Request>
<Response>BJ</Response>

<Field>
<Name>Delimiter</Name>
<Length>1</Length>
<Type>Character</Type>
<ValidValue>;</ValidValue>
</Field>

<Field>
<Name>Reserved</Name>
<Length>1</Length>
<Type>Character</Type>
<DependentField>Delimiter</DependentField>
<DependentValue>;</DependentValue>
<ExclusiveDependency>false</ExclusiveDependency>
</Field>

<Field>
<Name>Key Scheme LMK</Name>
<Length>1</Length>
<Type>Character</Type>
<DependentField>Delimiter</DependentField>
<DependentValue>;</DependentValue>
<ExclusiveDependency>false</ExclusiveDependency>
</Field>

<Field>
<Name>Reserved 2</Name>
<Length>1</Length>
<Type>Character</Type>
<DependentField>Delimiter</DependentField>
<DependentValue>;</DependentValue>
<ExclusiveDependency>false</ExclusiveDependency>
</Field>

</CommandConfiguration>

This indicates that the parser should use Delimiter as a field upon which the presence of multiple other fields depend. The original XML file is incorrect and causes the key scheme to not be parsed and have an empty value, hence the response code of 26.