- Problem
- Bootgen errors out with LMS/HSS key expiration during boot image generation.
- Bootgen Error Message
-
- ERROR
- Error generating LMS signature! This private key has generated all the signatures it is allowed.
- CAUSE
- The LMS (Leighton-Micali Signature) private key has reached its maximum signature limit based on the tree height parameter.
- WARNING
- Be careful when version controlling, backing up, and restoring LMS private keys. The private key file contains state. Re-using private key state leads to loss of authenticity. For more information, see NIST SP800-208 Sec. 9.1 NIST Special Publication (SP) 800-208, Recommendation for Stateful Hash-Based Signature Schemes.
- RESOLUTION
-
- Generate new LMS keys with appropriate tree height for your signature requirements
- Update the BIF file with the new LMS key files
- Regenerate the boot image
- Root Cause
- LMS is a hash-based signature scheme where each private key can only generate a limited number of signatures. The limit is determined by: Maximum Signatures = 2^H where H is the tree height parameter.
- Tree Height and Signature Limits
-
Table 1. Tree Height and Signature Limits Tree Height (H) Maximum Signatures Expiry After H = 5 32 signatures 32nd signature attempt H = 10 1,024 signatures 1,024th signature attempt H = 15 32,768 signatures 32,768th signature attempt H = 20 1,048,576 signatures 1,048,576th signature attempt - Solution
-
- Check current signature count in your build process
- Generate new LMS key pair with appropriate tree height
- Update BIF file with new key paths
- Plan key rotation before reaching signature limits
- Key State Management
-
- LMS private keys maintain internal state (signature counter)
- Each signature increments the counter
- Counter cannot be reset or decremented
- Key becomes unusable when counter reaches maximum