sync with OpenBSD -current

This commit is contained in:
purplerain 2024-04-10 21:48:14 +00:00
parent fe31ca4724
commit 2d743fc5aa
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
189 changed files with 3737 additions and 1337 deletions

View file

@ -1,4 +1,4 @@
/* $OpenBSD: rand.h,v 1.24 2023/11/19 15:46:10 tb Exp $ */
/* $OpenBSD: rand.h,v 1.25 2024/04/10 14:53:01 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -85,7 +85,6 @@ int RAND_set_rand_method(const RAND_METHOD *meth);
const RAND_METHOD *RAND_get_rand_method(void);
RAND_METHOD *RAND_SSLeay(void);
#ifndef LIBRESSL_INTERNAL
void RAND_cleanup(void );
int RAND_bytes(unsigned char *buf, int num);
int RAND_pseudo_bytes(unsigned char *buf, int num);
@ -96,7 +95,6 @@ int RAND_write_file(const char *file);
const char *RAND_file_name(char *file, size_t num);
int RAND_status(void);
int RAND_poll(void);
#endif
void ERR_load_RAND_strings(void);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: rand_lib.c,v 1.23 2023/11/19 15:46:10 tb Exp $ */
/* $OpenBSD: rand_lib.c,v 1.24 2024/04/10 14:53:01 beck Exp $ */
/*
* Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
*
@ -50,30 +50,35 @@ RAND_cleanup(void)
{
}
LCRYPTO_ALIAS(RAND_cleanup);
void
RAND_seed(const void *buf, int num)
{
}
LCRYPTO_ALIAS(RAND_seed);
void
RAND_add(const void *buf, int num, double entropy)
{
}
LCRYPTO_ALIAS(RAND_add);
int
RAND_status(void)
{
return 1;
}
LCRYPTO_ALIAS(RAND_status);
int
RAND_poll(void)
{
return 1;
}
LCRYPTO_ALIAS(RAND_poll);
/*
* Hurray. You've made it to the good parts.
@ -85,6 +90,7 @@ RAND_bytes(unsigned char *buf, int num)
arc4random_buf(buf, num);
return 1;
}
LCRYPTO_ALIAS(RAND_bytes);
int
RAND_pseudo_bytes(unsigned char *buf, int num)
@ -93,3 +99,4 @@ RAND_pseudo_bytes(unsigned char *buf, int num)
arc4random_buf(buf, num);
return 1;
}
LCRYPTO_ALIAS(RAND_pseudo_bytes);

View file

@ -1,4 +1,4 @@
/* $OpenBSD: randfile.c,v 1.44 2023/07/07 19:37:54 beck Exp $ */
/* $OpenBSD: randfile.c,v 1.45 2024/04/10 14:53:01 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@ -85,6 +85,7 @@ RAND_load_file(const char *file, long bytes)
else
return bytes;
}
LCRYPTO_ALIAS(RAND_load_file);
int
RAND_write_file(const char *file)
@ -133,6 +134,7 @@ RAND_write_file(const char *file)
explicit_bzero(buf, BUFSIZE);
return ret;
}
LCRYPTO_ALIAS(RAND_write_file);
const char *
RAND_file_name(char * buf, size_t size)
@ -141,3 +143,4 @@ RAND_file_name(char * buf, size_t size)
return (NULL);
return buf;
}
LCRYPTO_ALIAS(RAND_file_name);