• Juan Castillo's avatar
    TBB: use ASN.1 type DigestInfo to represent hashes · c3da66b1
    Juan Castillo authored
    The cert_create tool calculates the hash of each BL image and includes
    it as an ASN.1 OCTET STRING in the corresponding certificate extension.
    Without additional information, the firmware running on the platform
    has to know in advance the algorithm used to generate the hash.
    
    This patch modifies the cert_create tool so the certificate extensions
    that include an image hash are generated according to the following
    ASN.1 structure:
    
        DigestInfo ::= SEQUENCE {
            digestAlgorithm  AlgorithmIdentifier,
            digest           OCTET STRING
        }
    
        AlgorithmIdentifier ::=  SEQUENCE  {
            algorithm        OBJECT IDENTIFIER,
            parameters       ANY DEFINED BY algorithm OPTIONAL
        }
    
    The PolarSSL module has been updated to extract the image hash
    from the certificate extension according to this structure.
    
    Change-Id: I6d83430f12a8a0eea8447bec7c936e903f644c85
    c3da66b1
ext.c 7.88 KB