esp_image_format.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542
  1. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. // http://www.apache.org/licenses/LICENSE-2.0
  7. //
  8. // Unless required by applicable law or agreed to in writing, software
  9. // distributed under the License is distributed on an "AS IS" BASIS,
  10. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. // See the License for the specific language governing permissions and
  12. // limitations under the License.
  13. #include <string.h>
  14. #include <sys/param.h>
  15. #include <rom/rtc.h>
  16. #include <soc/cpu.h>
  17. #include <esp_image_format.h>
  18. #include <esp_secure_boot.h>
  19. #include <esp_log.h>
  20. #include <bootloader_flash.h>
  21. #include <bootloader_random.h>
  22. #include <bootloader_sha.h>
  23. static const char *TAG = "esp_image";
  24. #define HASH_LEN 32 /* SHA-256 digest length */
  25. #define SIXTEEN_MB 0x1000000
  26. #define ESP_ROM_CHECKSUM_INITIAL 0xEF
  27. /* Headroom to ensure between stack SP (at time of checking) and data loaded from flash */
  28. #define STACK_LOAD_HEADROOM 32768
  29. #ifdef BOOTLOADER_BUILD
  30. /* 64 bits of random data to obfuscate loaded RAM with, until verification is complete
  31. (Means loaded code isn't executable until after the secure boot check.)
  32. */
  33. static uint32_t ram_obfs_value[2];
  34. #endif
  35. /* Return true if load_addr is an address the bootloader should load into */
  36. static bool should_load(uint32_t load_addr);
  37. /* Return true if load_addr is an address the bootloader should map via flash cache */
  38. static bool should_map(uint32_t load_addr);
  39. /* Load or verify a segment */
  40. static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum);
  41. /* Verify the main image header */
  42. static esp_err_t verify_image_header(uint32_t src_addr, const esp_image_header_t *image, bool silent);
  43. /* Verify a segment header */
  44. static esp_err_t verify_segment_header(int index, const esp_image_segment_header_t *segment, uint32_t segment_data_offs, bool silent);
  45. /* Log-and-fail macro for use in esp_image_load */
  46. #define FAIL_LOAD(...) do { \
  47. if (!silent) { \
  48. ESP_LOGE(TAG, __VA_ARGS__); \
  49. } \
  50. goto err; \
  51. } \
  52. while(0)
  53. static esp_err_t verify_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data);
  54. static esp_err_t __attribute__((unused)) verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data);
  55. static esp_err_t __attribute__((unused)) verify_simple_hash(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data);
  56. esp_err_t esp_image_load(esp_image_load_mode_t mode, const esp_partition_pos_t *part, esp_image_metadata_t *data)
  57. {
  58. #ifdef BOOTLOADER_BUILD
  59. bool do_load = (mode == ESP_IMAGE_LOAD);
  60. #else
  61. bool do_load = false; // Can't load the image in app mode
  62. #endif
  63. bool silent = (mode == ESP_IMAGE_VERIFY_SILENT);
  64. esp_err_t err = ESP_OK;
  65. // checksum the image a word at a time. This shaves 30-40ms per MB of image size
  66. uint32_t checksum_word = ESP_ROM_CHECKSUM_INITIAL;
  67. bootloader_sha256_handle_t sha_handle = NULL;
  68. if (data == NULL || part == NULL) {
  69. return ESP_ERR_INVALID_ARG;
  70. }
  71. if (part->size > SIXTEEN_MB) {
  72. err = ESP_ERR_INVALID_ARG;
  73. FAIL_LOAD("partition size 0x%x invalid, larger than 16MB", part->size);
  74. }
  75. bzero(data, sizeof(esp_image_metadata_t));
  76. data->start_addr = part->offset;
  77. ESP_LOGD(TAG, "reading image header @ 0x%x", data->start_addr);
  78. err = bootloader_flash_read(data->start_addr, &data->image, sizeof(esp_image_header_t), true);
  79. if (err != ESP_OK) {
  80. goto err;
  81. }
  82. // Calculate SHA-256 of image if secure boot is on, or if image has a hash appended
  83. #ifdef CONFIG_SECURE_BOOT_ENABLED
  84. if (1) {
  85. #else
  86. if (data->image.hash_appended) {
  87. #endif
  88. sha_handle = bootloader_sha256_start();
  89. if (sha_handle == NULL) {
  90. return ESP_ERR_NO_MEM;
  91. }
  92. bootloader_sha256_data(sha_handle, &data->image, sizeof(esp_image_header_t));
  93. }
  94. ESP_LOGD(TAG, "image header: 0x%02x 0x%02x 0x%02x 0x%02x %08x",
  95. data->image.magic,
  96. data->image.segment_count,
  97. data->image.spi_mode,
  98. data->image.spi_size,
  99. data->image.entry_addr);
  100. err = verify_image_header(data->start_addr, &data->image, silent);
  101. if (err != ESP_OK) {
  102. goto err;
  103. }
  104. if (data->image.segment_count > ESP_IMAGE_MAX_SEGMENTS) {
  105. FAIL_LOAD("image at 0x%x segment count %d exceeds max %d",
  106. data->start_addr, data->image.segment_count, ESP_IMAGE_MAX_SEGMENTS);
  107. }
  108. uint32_t next_addr = data->start_addr + sizeof(esp_image_header_t);
  109. for(int i = 0; i < data->image.segment_count; i++) {
  110. esp_image_segment_header_t *header = &data->segments[i];
  111. ESP_LOGV(TAG, "loading segment header %d at offset 0x%x", i, next_addr);
  112. err = process_segment(i, next_addr, header, silent, do_load, sha_handle, &checksum_word);
  113. if (err != ESP_OK) {
  114. goto err;
  115. }
  116. next_addr += sizeof(esp_image_segment_header_t);
  117. data->segment_data[i] = next_addr;
  118. next_addr += header->data_len;
  119. }
  120. // Segments all loaded, verify length
  121. uint32_t end_addr = next_addr;
  122. if (end_addr < data->start_addr) {
  123. FAIL_LOAD("image offset has wrapped");
  124. }
  125. data->image_len = end_addr - data->start_addr;
  126. ESP_LOGV(TAG, "image start 0x%08x end of last section 0x%08x", data->start_addr, end_addr);
  127. err = verify_checksum(sha_handle, checksum_word, data);
  128. if (err != ESP_OK) {
  129. goto err;
  130. }
  131. if (data->image_len > part->size) {
  132. FAIL_LOAD("Image length %d doesn't fit in partition length %d", data->image_len, part->size);
  133. }
  134. bool is_bootloader = (data->start_addr == ESP_BOOTLOADER_OFFSET);
  135. /* For secure boot, we don't verify signature on bootloaders.
  136. For non-secure boot, we don't verify any SHA-256 hash appended to the bootloader because esptool.py may have
  137. rewritten the header - rely on esptool.py having verified the bootloader at flashing time, instead.
  138. */
  139. if (!is_bootloader) {
  140. #ifdef CONFIG_SECURE_BOOT_ENABLED
  141. // secure boot images have a signature appended
  142. err = verify_secure_boot_signature(sha_handle, data);
  143. #else
  144. // No secure boot, but SHA-256 can be appended for basic corruption detection
  145. if (sha_handle != NULL) {
  146. err = verify_simple_hash(sha_handle, data);
  147. }
  148. #endif // CONFIG_SECURE_BOOT_ENABLED
  149. } else { // is_bootloader
  150. // bootloader may still have a sha256 digest handle open
  151. if (sha_handle != NULL) {
  152. bootloader_sha256_finish(sha_handle, NULL);
  153. }
  154. }
  155. sha_handle = NULL;
  156. if (err != ESP_OK) {
  157. goto err;
  158. }
  159. #ifdef BOOTLOADER_BUILD
  160. if (do_load) { // Need to deobfuscate RAM
  161. for (int i = 0; i < data->image.segment_count; i++) {
  162. uint32_t load_addr = data->segments[i].load_addr;
  163. if (should_load(load_addr)) {
  164. uint32_t *loaded = (uint32_t *)load_addr;
  165. for (int j = 0; j < data->segments[i].data_len/sizeof(uint32_t); j++) {
  166. loaded[j] ^= (j & 1) ? ram_obfs_value[0] : ram_obfs_value[1];
  167. }
  168. }
  169. }
  170. }
  171. #endif
  172. // Success!
  173. return ESP_OK;
  174. err:
  175. if (err == ESP_OK) {
  176. err = ESP_ERR_IMAGE_INVALID;
  177. }
  178. if (sha_handle != NULL) {
  179. // Need to finish the hash process to free the handle
  180. bootloader_sha256_finish(sha_handle, NULL);
  181. }
  182. // Prevent invalid/incomplete data leaking out
  183. bzero(data, sizeof(esp_image_metadata_t));
  184. return err;
  185. }
  186. static esp_err_t verify_image_header(uint32_t src_addr, const esp_image_header_t *image, bool silent)
  187. {
  188. esp_err_t err = ESP_OK;
  189. if (image->magic != ESP_IMAGE_HEADER_MAGIC) {
  190. if (!silent) {
  191. ESP_LOGE(TAG, "image at 0x%x has invalid magic byte", src_addr);
  192. }
  193. err = ESP_ERR_IMAGE_INVALID;
  194. }
  195. if (!silent) {
  196. if (image->spi_mode > ESP_IMAGE_SPI_MODE_SLOW_READ) {
  197. ESP_LOGW(TAG, "image at 0x%x has invalid SPI mode %d", src_addr, image->spi_mode);
  198. }
  199. if (image->spi_speed > ESP_IMAGE_SPI_SPEED_80M) {
  200. ESP_LOGW(TAG, "image at 0x%x has invalid SPI speed %d", src_addr, image->spi_speed);
  201. }
  202. if (image->spi_size > ESP_IMAGE_FLASH_SIZE_MAX) {
  203. ESP_LOGW(TAG, "image at 0x%x has invalid SPI size %d", src_addr, image->spi_size);
  204. }
  205. }
  206. return err;
  207. }
  208. static esp_err_t process_segment(int index, uint32_t flash_addr, esp_image_segment_header_t *header, bool silent, bool do_load, bootloader_sha256_handle_t sha_handle, uint32_t *checksum)
  209. {
  210. esp_err_t err;
  211. /* read segment header */
  212. err = bootloader_flash_read(flash_addr, header, sizeof(esp_image_segment_header_t), true);
  213. if (err != ESP_OK) {
  214. ESP_LOGE(TAG, "bootloader_flash_read failed at 0x%08x", flash_addr);
  215. return err;
  216. }
  217. if (sha_handle != NULL) {
  218. bootloader_sha256_data(sha_handle, header, sizeof(esp_image_segment_header_t));
  219. }
  220. intptr_t load_addr = header->load_addr;
  221. uint32_t data_len = header->data_len;
  222. uint32_t data_addr = flash_addr + sizeof(esp_image_segment_header_t);
  223. ESP_LOGV(TAG, "segment data length 0x%x data starts 0x%x", data_len, data_addr);
  224. err = verify_segment_header(index, header, data_addr, silent);
  225. if (err != ESP_OK) {
  226. return err;
  227. }
  228. if (data_len % 4 != 0) {
  229. FAIL_LOAD("unaligned segment length 0x%x", data_len);
  230. }
  231. bool is_mapping = should_map(load_addr);
  232. do_load = do_load && should_load(load_addr);
  233. if (!silent) {
  234. ESP_LOGI(TAG, "segment %d: paddr=0x%08x vaddr=0x%08x size=0x%05x (%6d) %s",
  235. index, data_addr, load_addr,
  236. data_len, data_len,
  237. (do_load)?"load":(is_mapping)?"map":"");
  238. }
  239. if (do_load) {
  240. /* Before loading segment, check it doesn't clobber bootloader RAM... */
  241. uint32_t end_addr = load_addr + data_len;
  242. if (end_addr < 0x40000000) {
  243. intptr_t sp = (intptr_t)get_sp();
  244. if (end_addr > sp - STACK_LOAD_HEADROOM) {
  245. ESP_LOGE(TAG, "Segment %d end address 0x%08x too high (bootloader stack 0x%08x liimit 0x%08x)",
  246. index, end_addr, sp, sp - STACK_LOAD_HEADROOM);
  247. return ESP_ERR_IMAGE_INVALID;
  248. }
  249. }
  250. }
  251. const uint32_t *data = (const uint32_t *)bootloader_mmap(data_addr, data_len);
  252. if(!data) {
  253. ESP_LOGE(TAG, "bootloader_mmap(0x%x, 0x%x) failed",
  254. data_addr, data_len);
  255. return ESP_FAIL;
  256. }
  257. #ifdef BOOTLOADER_BUILD
  258. // Set up the obfuscation value to use for loading
  259. while (ram_obfs_value[0] == 0 || ram_obfs_value[1] == 0) {
  260. bootloader_fill_random(ram_obfs_value, sizeof(ram_obfs_value));
  261. }
  262. uint32_t *dest = (uint32_t *)load_addr;
  263. #endif
  264. const uint32_t *src = data;
  265. for (int i = 0; i < data_len; i += 4) {
  266. int w_i = i/4; // Word index
  267. uint32_t w = src[w_i];
  268. *checksum ^= w;
  269. #ifdef BOOTLOADER_BUILD
  270. if (do_load) {
  271. dest[w_i] = w ^ ((w_i & 1) ? ram_obfs_value[0] : ram_obfs_value[1]);
  272. }
  273. #endif
  274. // SHA_CHUNK determined experimentally as the optimum size
  275. // to call bootloader_sha256_data() with. This is a bit
  276. // counter-intuitive, but it's ~3ms better than using the
  277. // SHA256 block size.
  278. const size_t SHA_CHUNK = 1024;
  279. if (sha_handle != NULL && i % SHA_CHUNK == 0) {
  280. bootloader_sha256_data(sha_handle, &src[w_i],
  281. MIN(SHA_CHUNK, data_len - i));
  282. }
  283. }
  284. bootloader_munmap(data);
  285. return ESP_OK;
  286. err:
  287. if (err == ESP_OK) {
  288. err = ESP_ERR_IMAGE_INVALID;
  289. }
  290. return err;
  291. }
  292. static esp_err_t verify_segment_header(int index, const esp_image_segment_header_t *segment, uint32_t segment_data_offs, bool silent)
  293. {
  294. if ((segment->data_len & 3) != 0
  295. || segment->data_len >= SIXTEEN_MB) {
  296. if (!silent) {
  297. ESP_LOGE(TAG, "invalid segment length 0x%x", segment->data_len);
  298. }
  299. return ESP_ERR_IMAGE_INVALID;
  300. }
  301. uint32_t load_addr = segment->load_addr;
  302. bool map_segment = should_map(load_addr);
  303. /* Check that flash cache mapped segment aligns correctly from flash to its mapped address,
  304. relative to the 64KB page mapping size.
  305. */
  306. ESP_LOGV(TAG, "segment %d map_segment %d segment_data_offs 0x%x load_addr 0x%x",
  307. index, map_segment, segment_data_offs, load_addr);
  308. if (map_segment
  309. && ((segment_data_offs % SPI_FLASH_MMU_PAGE_SIZE) != (load_addr % SPI_FLASH_MMU_PAGE_SIZE))) {
  310. if (!silent) {
  311. ESP_LOGE(TAG, "Segment %d load address 0x%08x, doesn't match data 0x%08x",
  312. index, load_addr, segment_data_offs);
  313. }
  314. return ESP_ERR_IMAGE_INVALID;
  315. }
  316. return ESP_OK;
  317. }
  318. static bool should_map(uint32_t load_addr)
  319. {
  320. return (load_addr >= SOC_IROM_LOW && load_addr < SOC_IROM_HIGH)
  321. || (load_addr >= SOC_DROM_LOW && load_addr < SOC_DROM_HIGH);
  322. }
  323. static bool should_load(uint32_t load_addr)
  324. {
  325. /* Reload the RTC memory segments whenever a non-deepsleep reset
  326. is occurring */
  327. bool load_rtc_memory = rtc_get_reset_reason(0) != DEEPSLEEP_RESET;
  328. if (should_map(load_addr)) {
  329. return false;
  330. }
  331. if (load_addr < 0x10000000) {
  332. // Reserved for non-loaded addresses.
  333. // Current reserved values are
  334. // 0x0 (padding block)
  335. // 0x4 (unused, but reserved for an MD5 block)
  336. return false;
  337. }
  338. if (!load_rtc_memory) {
  339. if (load_addr >= SOC_RTC_IRAM_LOW && load_addr < SOC_RTC_IRAM_HIGH) {
  340. ESP_LOGD(TAG, "Skipping RTC code segment at 0x%08x\n", load_addr);
  341. return false;
  342. }
  343. if (load_addr >= SOC_RTC_DATA_LOW && load_addr < SOC_RTC_DATA_HIGH) {
  344. ESP_LOGD(TAG, "Skipping RTC data segment at 0x%08x\n", load_addr);
  345. return false;
  346. }
  347. }
  348. return true;
  349. }
  350. esp_err_t esp_image_verify_bootloader(uint32_t *length)
  351. {
  352. esp_image_metadata_t data;
  353. const esp_partition_pos_t bootloader_part = {
  354. .offset = ESP_BOOTLOADER_OFFSET,
  355. .size = ESP_PARTITION_TABLE_OFFSET - ESP_BOOTLOADER_OFFSET,
  356. };
  357. esp_err_t err = esp_image_load(ESP_IMAGE_VERIFY,
  358. &bootloader_part,
  359. &data);
  360. if (length != NULL) {
  361. *length = (err == ESP_OK) ? data.image_len : 0;
  362. }
  363. return err;
  364. }
  365. static esp_err_t verify_checksum(bootloader_sha256_handle_t sha_handle, uint32_t checksum_word, esp_image_metadata_t *data)
  366. {
  367. uint32_t unpadded_length = data->image_len;
  368. uint32_t length = unpadded_length + 1; // Add a byte for the checksum
  369. length = (length + 15) & ~15; // Pad to next full 16 byte block
  370. // Verify checksum
  371. uint8_t buf[16];
  372. esp_err_t err = bootloader_flash_read(data->start_addr + unpadded_length, buf, length - unpadded_length, true);
  373. uint8_t calc = buf[length - unpadded_length - 1];
  374. uint8_t checksum = (checksum_word >> 24)
  375. ^ (checksum_word >> 16)
  376. ^ (checksum_word >> 8)
  377. ^ (checksum_word >> 0);
  378. if (err != ESP_OK || checksum != calc) {
  379. ESP_LOGE(TAG, "Checksum failed. Calculated 0x%x read 0x%x", checksum, calc);
  380. return ESP_ERR_IMAGE_INVALID;
  381. }
  382. if (sha_handle != NULL) {
  383. bootloader_sha256_data(sha_handle, buf, length - unpadded_length);
  384. }
  385. if (data->image.hash_appended) {
  386. // Account for the hash in the total image length
  387. length += HASH_LEN;
  388. }
  389. data->image_len = length;
  390. return ESP_OK;
  391. }
  392. static void debug_log_hash(const uint8_t *image_hash, const char *caption);
  393. static esp_err_t verify_secure_boot_signature(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data)
  394. {
  395. uint8_t image_hash[HASH_LEN] = { 0 };
  396. // For secure boot, we calculate the signature hash over the whole file, which includes any "simple" hash
  397. // appended to the image for corruption detection
  398. if (data->image.hash_appended) {
  399. const void *simple_hash = bootloader_mmap(data->start_addr + data->image_len - HASH_LEN, HASH_LEN);
  400. bootloader_sha256_data(sha_handle, simple_hash, HASH_LEN);
  401. bootloader_munmap(simple_hash);
  402. }
  403. bootloader_sha256_finish(sha_handle, image_hash);
  404. // Log the hash for debugging
  405. debug_log_hash(image_hash, "Calculated secure boot hash");
  406. // Use hash to verify signature block
  407. const esp_secure_boot_sig_block_t *sig_block = bootloader_mmap(data->start_addr + data->image_len, sizeof(esp_secure_boot_sig_block_t));
  408. esp_err_t err = esp_secure_boot_verify_signature_block(sig_block, image_hash);
  409. bootloader_munmap(sig_block);
  410. if (err != ESP_OK) {
  411. ESP_LOGE(TAG, "Secure boot signature verification failed");
  412. // Go back and check if the simple hash matches or not (we're off the fast path so we can re-hash the whole image now)
  413. ESP_LOGI(TAG, "Calculating simple hash to check for corruption...");
  414. const void *whole_image = bootloader_mmap(data->start_addr, data->image_len - HASH_LEN);
  415. if (whole_image != NULL) {
  416. sha_handle = bootloader_sha256_start();
  417. bootloader_sha256_data(sha_handle, whole_image, data->image_len - HASH_LEN);
  418. bootloader_munmap(whole_image);
  419. if (verify_simple_hash(sha_handle, data) != ESP_OK) {
  420. ESP_LOGW(TAG, "image corrupted on flash");
  421. } else {
  422. ESP_LOGW(TAG, "image valid, signature bad");
  423. }
  424. }
  425. return ESP_ERR_IMAGE_INVALID;
  426. }
  427. return ESP_OK;
  428. }
  429. static esp_err_t verify_simple_hash(bootloader_sha256_handle_t sha_handle, esp_image_metadata_t *data)
  430. {
  431. uint8_t image_hash[HASH_LEN] = { 0 };
  432. bootloader_sha256_finish(sha_handle, image_hash);
  433. // Log the hash for debugging
  434. debug_log_hash(image_hash, "Calculated hash");
  435. // Simple hash for verification only
  436. const void *hash = bootloader_mmap(data->start_addr + data->image_len - HASH_LEN, HASH_LEN);
  437. if (memcmp(hash, image_hash, HASH_LEN) != 0) {
  438. ESP_LOGE(TAG, "Image hash failed - image is corrupt");
  439. debug_log_hash(hash, "Expected hash");
  440. bootloader_munmap(hash);
  441. return ESP_ERR_IMAGE_INVALID;
  442. }
  443. bootloader_munmap(hash);
  444. return ESP_OK;
  445. }
  446. // Log a hash as a hex string
  447. static void debug_log_hash(const uint8_t *image_hash, const char *label)
  448. {
  449. #if BOOT_LOG_LEVEL >= LOG_LEVEL_DEBUG
  450. char hash_print[sizeof(image_hash)*2 + 1];
  451. hash_print[sizeof(image_hash)*2] = 0;
  452. for (int i = 0; i < sizeof(image_hash); i++) {
  453. for (int shift = 0; shift < 2; shift++) {
  454. uint8_t nibble = (image_hash[i] >> (shift ? 0 : 4)) & 0x0F;
  455. if (nibble < 10) {
  456. hash_print[i*2+shift] = '0' + nibble;
  457. } else {
  458. hash_print[i*2+shift] = 'a' + nibble - 10;
  459. }
  460. }
  461. }
  462. ESP_LOGD(TAG, "%s: %s", label, hash_print);
  463. #endif
  464. }