X-Git-Url: http://git.ozlabs.org/?p=ppp.git;a=blobdiff_plain;f=pppd%2Fsha1.h;h=83f64df25843ac6f8bbd1bfe686a00c09ff8716a;hp=dff8da88bd91a041f616e9fb34020c9958144099;hb=3e451dfe42426b51e6ce1d66a3e04de43e055568;hpb=b38527fb14af5ebe3d2559e2f861575c722a1ce9 diff --git a/pppd/sha1.h b/pppd/sha1.h index dff8da8..83f64df 100644 --- a/pppd/sha1.h +++ b/pppd/sha1.h @@ -1,18 +1,31 @@ /* sha1.h */ +/* If OpenSSL is in use, then use that version of SHA-1 */ +#ifdef OPENSSL +#include +#define __SHA1_INCLUDE_ +#endif + #ifndef __SHA1_INCLUDE_ +#ifndef SHA1_SIGNATURE_SIZE +#ifdef SHA_DIGESTSIZE +#define SHA1_SIGNATURE_SIZE SHA_DIGESTSIZE +#else +#define SHA1_SIGNATURE_SIZE 20 +#endif +#endif + typedef struct { - unsigned long state[5]; - unsigned long count[2]; + u_int32_t state[5]; + u_int32_t count[2]; unsigned char buffer[64]; } SHA1_CTX; -#define SHA1_SIGNATURE_SIZE 20 - extern void SHA1_Init(SHA1_CTX *); extern void SHA1_Update(SHA1_CTX *, const unsigned char *, unsigned int); extern void SHA1_Final(unsigned char[SHA1_SIGNATURE_SIZE], SHA1_CTX *); #define __SHA1_INCLUDE_ #endif /* __SHA1_INCLUDE_ */ +