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