Witam,
Starsza metoda szyfrowania haseł w Gadu-Gadu jest (chyba) odrzucana, dlatego potrzebuje SHA.
A więc w kompilatorze Dev-Cpp ściągam paczke OpenSSL, następnie gdy już ją zainstaluje w projekcie dodaje: #include <openssl/sha.h>
Problem polega na tym, gdy dodaje funkcje (z godnie z dokumentacją protokołu gg):
char *gg_sha_hash(char *password, unsigned int seed)
{
SHA1_CTX ctx;
static char result[20];
SHA1_Init(&ctx);
SHA1_Update(&ctx, password, strlen(password));
SHA1_Update(&ctx, &seed, sizeof(seed));
SHA1_Final(result, &ctx);
return result;
}
Wywala mi:
C:\Dev-Cpp\main.cpp In function `char* gg_sha_hash(char*, unsigned int)':
10 C:\Dev-Cpp\main.cpp `SHA1_CTX' undeclared (first use this function)
(Each undeclared identifier is reported only once for each function it appears in.)
10 C:\Dev-Cpp\main.cpp expected `;' before "ctx"
13 C:\Dev-Cpp\main.cpp `ctx' undeclared (first use this function)
C:\Dev-Cpp\Makefile.win [Build Error] [main.o] Error 1
W konsolidatorze ładuje jeszcze libssl.a (probowalem jeszcze libeay.a)
Co robię źle?
Dziękuję i proszę o wyrozumiałość.