[PATCH 02/12] random: Implement read_random via getentropy.

Gedare Bloom gedare at rtems.org
Wed Aug 1 14:28:21 UTC 2018


Is this relied on for IPSec? How secure is it?

On Wed, Aug 1, 2018 at 4:04 AM, Christian Mauderer
<christian.mauderer at embedded-brains.de> wrote:
> ---
>  freebsd/sys/sys/random.h | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/freebsd/sys/sys/random.h b/freebsd/sys/sys/random.h
> index 396ec2b1..996ca5c1 100644
> --- a/freebsd/sys/sys/random.h
> +++ b/freebsd/sys/sys/random.h
> @@ -50,11 +50,21 @@ read_random_uio(void *a __unused, u_int b __unused)
>  {
>         return (0);
>  }
> +#ifndef __rtems__
>  static __inline u_int
>  read_random(void *a __unused, u_int b __unused)
>  {
>         return (0);
>  }
> +#else /* __rtems__ */
> +#include <unistd.h>
> +static __inline u_int
> +read_random(void *ptr, u_int n)
> +{
> +       getentropy(ptr, n);
> +       return (n);
> +}
> +#endif /* __rtems__ */
>  #endif
>
>  /*
> --
> 2.13.7
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list