1/* vi: set sw=4 ts=4: */ 2/* 3 * Utility routine. 4 * 5 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org> 6 * 7 * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. 8 */ 9 10#include "libbb.h" 11#include <crypt.h> 12 13char *pw_encrypt(const char *clear, const char *salt) 14{ 15 /* Was static char[BIGNUM]. Malloced thing works as well */ 16 static char *cipher; 17 18 19 free(cipher); 20 cipher = xstrdup(crypt(clear, salt)); 21 return cipher; 22} 23