Added SHA-256 encryption
SVN revision: 2316
This commit is contained in:
@@ -199,6 +199,10 @@
|
||||
Name="Source Files"
|
||||
Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
|
||||
>
|
||||
<File
|
||||
RelativePath="..\src\crypt.c"
|
||||
>
|
||||
</File>
|
||||
<File
|
||||
RelativePath="..\src\elog.c"
|
||||
>
|
||||
|
||||
+3
-1
@@ -5,7 +5,8 @@ On PC6562:
|
||||
|
||||
- Put all new options in doc/config.html
|
||||
- Increse version in elogd.c and elog.c
|
||||
- Do the same in doc/index.html and index_d.html
|
||||
- Do the same in doc/index.html and index_nd.html
|
||||
- copy index_nd.html to index.html on web server
|
||||
- Modify ChangeLog
|
||||
- Add release date to ChangeLog
|
||||
- Do a "make indent"
|
||||
@@ -13,6 +14,7 @@ On PC6562:
|
||||
- Translate new strings in eloglang.german
|
||||
- c:\elog> svn ci -m "Release x.x.x-y"
|
||||
- open VS 2008 command window, build xxx-1 in c:\elog
|
||||
- copy index_nd.html to index.html on web server
|
||||
|
||||
On midas.psi.ch:
|
||||
|
||||
|
||||
+3
-9
@@ -24,10 +24,6 @@ static const char ELOGID[] = "elog " VERSION " built " __DATE__ ", " __TIME__;
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#ifndef __USE_XOPEN
|
||||
#define __USE_XOPEN /* needed for crypt() */
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
@@ -190,13 +186,11 @@ size_t strlcat(char *dst, const char *src, size_t size)
|
||||
#endif // STRLCPY_DEFINED
|
||||
|
||||
|
||||
char *sha256_crypt(const char *key, const char *salt);
|
||||
|
||||
void do_crypt(char *s, char *d, int size)
|
||||
{
|
||||
#ifdef HAVE_CRYPT
|
||||
strlcpy(d, crypt(s, "el"), size);
|
||||
#else
|
||||
base64_encode((unsigned char *) s, (unsigned char *) d, size);
|
||||
#endif
|
||||
strlcpy(d, sha256_crypt(s, "$5$") + 4, size);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user