summaryrefslogtreecommitdiff
path: root/src/misc/crypt_r.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/misc/crypt_r.c')
-rw-r--r--src/misc/crypt_r.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/misc/crypt_r.c b/src/misc/crypt_r.c
index f4716d6f..1c7f9cf0 100644
--- a/src/misc/crypt_r.c
+++ b/src/misc/crypt_r.c
@@ -6,6 +6,8 @@ struct crypt_data;
char *__crypt_des(const char *, const char *, char *);
char *__crypt_md5(const char *, const char *, char *);
char *__crypt_blowfish(const char *, const char *, char *);
+char *__crypt_sha256(const char *, const char *, char *);
+char *__crypt_sha512(const char *, const char *, char *);
char *__crypt_r(const char *key, const char *salt, struct crypt_data *data)
{
@@ -17,6 +19,10 @@ char *__crypt_r(const char *key, const char *salt, struct crypt_data *data)
#endif
if (salt[1] == '2' && salt[3] == '$')
return __crypt_blowfish(key, salt, output);
+ if (salt[1] == '5' && salt[2] == '$')
+ return __crypt_sha256(key, salt, output);
+ if (salt[1] == '6' && salt[2] == '$')
+ return __crypt_sha512(key, salt, output);
}
return __crypt_des(key, salt, output);
}