Diff

Differences From Artifact [c49efbf6f1]:

To Artifact [1cd87f2aca]:


     7      7   
     8      8   		continue
     9      9   	fi
    10     10   
    11     11   	openssl x509 -in "${file}" -out tmpfile.x509 -inform pem -outform der
    12     12   
    13     13   	pubkeylen="$(openssl x509 -in tmpfile.x509 -inform der -text -noout | grep 'RSA Public Key:' | sed 's@^.*(\([0-9][0-9]*\) bit).*$@\1@')"
    14         -	certlen="$(stat -c '%s' tmpfile.x509)"
           14  +	certlen="$(cat tmpfile.x509 | wc -c)"
    15     15   	cert="$(( cat tmpfile.x509 | od -t x1 | cut -c 9- | tr "\n" ' '; echo ) | sed 's@ @@g;s@..@\\x&@g')"
    16     16   
    17     17   	cat << _EOF_
    18     18   	{
    19         -		{0},
    20         -		0,
    21         -		${certlen},
    22         -		(unsigned char *) "${cert}",
    23         -		${pubkeylen}
           19  +		CACKEY_ID_TYPE_CERT_ONLY, /* id_type */
           20  +		${certlen}, /* certificate_len */
           21  +		(unsigned char *) "${cert}", /* certificate */
           22  +		${pubkeylen} /* keysize */
    24     23   	},
    25     24   _EOF_
    26     25   done
    27     26   
    28     27   rm -f tmpfile.x509