Use openssl instead of sha1sum

Change-Id: Iab8a74d4af6646104cb23312853f811a38bdec0d
merge changes from CyanogenMod 10.2 into local branch