-/* $OpenBSD: cryptutil.c,v 1.5 2014/11/24 21:36:35 tedu Exp $ */
+/* $OpenBSD: cryptutil.c,v 1.6 2014/12/24 22:10:34 tedu Exp $ */
/*
* Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
*
if (goodhash == NULL) {
/* fake it */
- bcrypt_newhash(pass, 8, dummy, sizeof(dummy));
- goto fail;
+ goto fake;
}
/* empty password */
return 0;
}
- /* have to do it the hard way */
- res = crypt(pass, goodhash);
- if (res == NULL || strlen(res) != strlen(goodhash) ||
- timingsafe_bcmp(res, goodhash, strlen(goodhash)) != 0) {
- goto fail;
- }
-
- return 0;
+ /* unsupported. fake it. */
+fake:
+ bcrypt_newhash(pass, 8, dummy, sizeof(dummy));
fail:
errno = EACCES;
return -1;