RSA Security 4.3 Creating the Hardware Chooser, Creating the Session Chooser, The Session Chooser

Models: 4.3

1 38
Download 38 pages 55.71 Kb
Page 12
Image 12
Creating the Hardware Chooser

The Session Chooser

Creating the Hardware Chooser

A hardware chooser is a list of manufacturer-supplied HW_TABLE_ENTRYs. Each entry defines the necessary code for accessing the specified piece of hardware. In the case of the Intel hardware random generator, use HW_INTEL_RANDOM.

If you wish, the hardware chooser can contain several HW_TABLE_ENTRYs, possibly supplied by different manufacturers, that all correspond to the same AM in the software chooser. If more than one hardware method can be matched to a single software method, then the hardware method listed first in the hardware chooser is associated with that software method. This association is normally created at link time. This offers applications the option to ensure a certain level of security by requiring specific hardware. However, the list can be modified at run time by creating the hardware chooser at run time, and specifying the order of the HW_TABLE_ENTRYs at that time.

If the hardware corresponding to the first method is not available, then Crypto-C continues down the list in order until a method corresponding to available hardware is found. If there is no hardware available for this method, then it defaults to the software method, if available, or returns an error if not.

HW_TABLE_ENTRY *HARDWARE_CHOOSER[] = { &HW_INTEL_RANDOM, (HW_TABLE_ENTRY *)NULL_PTR

};

Creating the Session Chooser

Once you have declared the software and hardware choosers, you can call B_CreateSessionChooser to associate a hardware method (for example, HW_INTEL_RANDOM) with a software method (AM_HW_RANDOM) so that when a software method is called, it turns to the hardware. In this example, HW_INTEL_RANDOM will be called when AM_HW_RANDOM is referenced.

if ((status = B_CreateSessionChooser

(SOFTWARE_CHOOSER, &CHOOSER, (POINTER *)HARDWARE_CHOOSER, (ITEM *)NULL_PTR, NULL_PTR, &oemTagList)) != 0)

break;

The session chooser you have created should be passed in as the chooser when you

8

R S A B S A F E C r y p t o - C I n t e l H a r d w a r e U s e r ’s G u i d e

Page 12
Image 12
RSA Security 4.3 manual Creating the Hardware Chooser, Creating the Session Chooser, The Session Chooser, break