Wrap ShadowHashData setting into its own method
Previously, the act of setting the ShadowHashData key in the
user's plist was performed in the set_salted_sha512() and
set_salted_pbkdf2() methods. This commit wraps that behavior
into its own method for uniformity.
There was also a condition where a user account that has an
old-style password hash (10.6 or earlier) could exist on a
10.7 or 10.8 machine that had been upgraded. If this user
hadn't logged-in to the machine, then their password hash
would continue to be stored on-disk (versus being stored
in the ShadowHashData key of the user's plist). Previously,
the code made the assumption that if the machine had an
operating system version of 10.7 or 10.8, then the
ShadowHashData key would exist in the user's plist. This
was a false assumption, based on the edge case I described
previously. This commit adds the check for the ShadowHashData
key in the set_shadow_hash_data method and will adapt accordingly.