]> Pileus Git - ~andy/linux/blobdiff - scripts/sign-file
kbuild: Fix module signature generation
[~andy/linux] / scripts / sign-file
index 095a953bdb8e6078e0d654bc23d928513d58b7a4..d014abd11f1c922ca21777e038475ce44e5465c9 100644 (file)
@@ -81,11 +81,12 @@ openssl dgst $dgst -binary $mod || exit $?
 # the signature with no metadata attached.
 #
 openssl rsautl -sign -inkey $key -keyform PEM -in $mod.dig -out $mod.sig || exit $?
+siglen=`stat -c %s $mod.sig`
 
 SIGNER="`perl $keyid_script $x509 signer-name`"
 KEYID="`perl $keyid_script $x509 keyid`"
-keyidlen=${#KEYID}
-siglen=${#SIGNER}
+keyidlen=$(echo -n "$KEYID" | wc -c)
+signerlen=$(echo -n "$SIGNER" | wc -c)
 
 #
 # Build the signed binary