.. | .. |
---|
86 | 86 | uint8_t buf[sig_len]; |
---|
87 | 87 | rsa_key rsa_key; |
---|
88 | 88 | int i, ret; |
---|
| 89 | +#ifdef CONFIG_FIT_ENABLE_RSA4096_SUPPORT |
---|
| 90 | + if (key_len != RSA4096_BYTES) |
---|
| 91 | + return -EINVAL; |
---|
89 | 92 | |
---|
| 93 | + rsa_key.algo = CRYPTO_RSA4096; |
---|
| 94 | +#else |
---|
90 | 95 | if (key_len != RSA2048_BYTES) |
---|
91 | 96 | return -EINVAL; |
---|
92 | 97 | |
---|
93 | 98 | rsa_key.algo = CRYPTO_RSA2048; |
---|
| 99 | +#endif |
---|
94 | 100 | rsa_key.n = malloc(key_len); |
---|
95 | 101 | rsa_key.e = malloc(key_len); |
---|
96 | 102 | rsa_key.c = malloc(key_len); |
---|
.. | .. |
---|
599 | 605 | struct udevice *dev; |
---|
600 | 606 | struct key_prop prop; |
---|
601 | 607 | char name[100] = {0}; |
---|
602 | | - u16 secure_boot_enable = 0; |
---|
| 608 | + u16 secure_flags = 0; |
---|
603 | 609 | const void *blob = info->fdt_blob; |
---|
604 | 610 | uint8_t digest[FIT_MAX_HASH_LEN]; |
---|
605 | 611 | uint8_t digest_read[FIT_MAX_HASH_LEN]; |
---|
.. | .. |
---|
610 | 616 | return -ENODEV; |
---|
611 | 617 | |
---|
612 | 618 | ret = misc_otp_read(dev, OTP_SECURE_BOOT_ENABLE_ADDR, |
---|
613 | | - &secure_boot_enable, OTP_SECURE_BOOT_ENABLE_SIZE); |
---|
| 619 | + &secure_flags, OTP_SECURE_BOOT_ENABLE_SIZE); |
---|
614 | 620 | if (ret) |
---|
615 | 621 | return ret; |
---|
616 | 622 | |
---|
617 | | - if (secure_boot_enable) |
---|
| 623 | + if (secure_flags == 0xff) |
---|
618 | 624 | return 0; |
---|
619 | 625 | |
---|
620 | 626 | sig_node = fdt_subnode_offset(blob, 0, FIT_SIG_NODENAME); |
---|
.. | .. |
---|
701 | 707 | goto error; |
---|
702 | 708 | } |
---|
703 | 709 | |
---|
704 | | - secure_boot_enable = 0xff; |
---|
| 710 | + secure_flags = 0xff; |
---|
705 | 711 | ret = misc_otp_write(dev, OTP_SECURE_BOOT_ENABLE_ADDR, |
---|
706 | | - &secure_boot_enable, OTP_SECURE_BOOT_ENABLE_SIZE); |
---|
| 712 | + &secure_flags, OTP_SECURE_BOOT_ENABLE_SIZE); |
---|
707 | 713 | if (ret) |
---|
708 | 714 | goto error; |
---|
709 | 715 | |
---|