Skip to content

Commit

Permalink
Fix #7904
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Sep 26, 2024
1 parent 6834e36 commit f8bdc3d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions kitty/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@
#include <sys/mman.h>
#include <structmember.h>

#ifdef LIBRESSL_VERSION_NUMBER
/* from: https://github.com/libressl/portable/blob/master/include/compat/string.h#L63 */
#define explicit_bzero libressl_explicit_bzero
void explicit_bzero(void *, size_t);
/* from: https://github.com/libressl/portable/blob/master/crypto/compat/freezero.c */
void
freezero(void *ptr, size_t sz) {
if (ptr == NULL) return;
explicit_bzero(ptr, sz);
free(ptr);
}
#define OPENSSL_clear_free freezero
#endif

#define SHA1_DIGEST_LENGTH SHA_DIGEST_LENGTH

typedef enum HASH_ALGORITHM { SHA1_HASH, SHA224_HASH, SHA256_HASH, SHA384_HASH, SHA512_HASH } HASH_ALGORITHM;
Expand Down

0 comments on commit f8bdc3d

Please sign in to comment.