<html><body><p><tt>Hi Stefan,</tt><br><br><tt>> }<br>> <br>> +uint32_t tpm_measure_scrtm(void)<br>> +{<br>> + uint32_t rc;<br>> +<br>> + extern long print_version, print_version_end;<br>> + extern long _slof_data, _slof_data_end;<br>> +</tt><br><tt>How are we getting the storage of all these variables declared? Base on the C codes alone, there is no memory allocated with the 'extern' keywords used here and I expected compiler errors on the following 4 lines of code for referencing them. </tt><br><br><br><tt>> + char *version_start = (char *)&print_version;<br>> + uint32_t version_length = (long)&print_version_end - (long)&print_version;<br>> +<br>> + char *slof_start = (char *)&_slof_data;<br>> + uint32_t slof_length = (long)&_slof_data_end - (long)&_slof_data;<br>> +<br>> + const char *scrtm = "S-CRTM Contents";<br>> +<br>> + dprintf("Measure S-CRTM Version: addr = %p, length = %d\n",<br>> + version_start, version_length);<br>> +<br>> + rc = tpm_add_measurement_to_log(0, EV_S_CRTM_VERSION,<br>> + version_start, version_length,<br>> + (uint8_t *)version_start,<br>> + version_length);<br>> +<br>> + if (rc)<br>> + return rc;<br>> +<br>> + dprintf("Measure S-CRTM Content: start = %p, length = %d\n",<br>> + &slof_start, slof_length);<br>> +<br>> + rc = tpm_add_measurement_to_log(0, EV_S_CRTM_CONTENTS,<br>> + scrtm, strlen(scrtm),<br>> + (uint8_t *)slof_start, slof_length);<br>> +<br>> + return rc;<br>> +}<br>> +<br></tt><br>Regards,<br>Vicky<br><br>Hon Ching (Vicky) Lo<br>Linux Security Development<br>Notes: lo1@us.ibm.com<br>Office: 845-435-8946 (T/L: 295-8946)<br><BR>
</body></html>