Allow building without libbsd on Linux when NOCRYPT symbol is defined.

This commit is contained in:
Tatsuhisa Yamaguchi 2017-12-18 14:57:43 +09:00
parent 4966c4d65f
commit b276027de0
2 changed files with 4 additions and 0 deletions

View File

@ -84,6 +84,7 @@ void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab)
/***************************************************************************/
#ifndef NOCRYPT
int cryptrand(unsigned char *buf, unsigned int len)
{
#ifdef _WIN32
@ -140,5 +141,6 @@ int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
buf[n++] = (uint8_t)zencode(pkeys, pcrc_32_tab, verify2, t);
return n;
}
#endif
/***************************************************************************/

View File

@ -48,12 +48,14 @@ uint8_t update_keys(uint32_t *pkeys, const z_crc_t *pcrc_32_tab, int32_t c);
/* Initialize the encryption keys and the random header according to the given password. */
void init_keys(const char *passwd, uint32_t *pkeys, const z_crc_t *pcrc_32_tab);
#ifndef NOCRYPT
/* Generate cryptographically secure random numbers */
int cryptrand(unsigned char *buf, unsigned int len);
/* Create encryption header */
int crypthead(const char *passwd, uint8_t *buf, int buf_size, uint32_t *pkeys,
const z_crc_t *pcrc_32_tab, uint8_t verify1, uint8_t verify2);
#endif
/***************************************************************************/