[PATCH] Make get_sha1_basic() more careful