[ipxe-devel] EFI enhancements for https

Jarrod Johnson jarrod.b.johnson at gmail.com
Tue Oct 29 23:23:44 UTC 2013


No problem, if I can be smart enough ;)

Currently I'm trying to understand how things fit together (by looking at
how rtc_entropy hooks in) and how errfile.h should go.

For reference, the meat of the entropy thing I was thinking to look like:
uint8_t efi_sample ( void ) {
    EFI_BOOT_SERVICES *bs = efi_systab->BootServices;
    EFI_EVENT waiter;
    unsigned long before;
    unsigned long after;
    EFI_STATUS efirc;
    EFI_TIMER_DELAY delay = TimerRelative;
    UINTN discard;
    /* int rc; */

    if ( ( efirc = bs->CreateEvent ( EVT_TIMER, TPL_NOTIFY,
                    NULL, NULL, &waiter ) ) != 0){
        /* TODO: I don't know how to wrangle errfile.h......
         * rc = -EEFI ( efirc );
         */
        return efirc;
    }
    bs->SetTimer(waiter, delay, 0);
    bs->WaitForEvent(1, &waiter, &discard);
    before = currticks();
    bs->SetTimer(waiter, delay, 0);
    bs->WaitForEvent(1, &waiter, &discard);
    after = currticks();
    bs->CloseEvent(waiter);
    return ( after - before );
}


That at least compiles as interface/efi/efi_entropy.c.....


On Tue, Oct 29, 2013 at 6:42 PM, Michael Brown <mcb30 at ipxe.org> wrote:

> On 29/10/13 20:22, Jarrod Johnson wrote:
>
>> I guess I'm embarking upon trying to provide two stubbed out things in
>> efi.
>> time:  Straightforward enough, use the GetTime() runtime service
>>
>> entropy.  For now ignore the 2.4 RNG since I have no way of testing it,
>> just port forward the rtc logic:
>> -call efi_currticks (defined in efi_timer.c)
>> -createevent to make a timer event
>> -settimer to schedule it to fire (will try for TimerRelative, 0)
>> -waitevent
>> -call efi_currticks again
>>
>
> Both sound sensible to me.  Thanks for doing this.
>
> Michael
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ipxe.org/pipermail/ipxe-devel/attachments/20131029/0cc27f94/attachment.htm>


More information about the ipxe-devel mailing list