mbox series

[BlueZ,V2,0/5] Replace random number generation function

Message ID 20211208223923.519664-1-hj.tedd.an@gmail.com (mailing list archive)
Headers show
Series Replace random number generation function | expand

Message

Tedd Ho-Jeong An Dec. 8, 2021, 10:39 p.m. UTC
From: Tedd Ho-Jeong An <tedd.an@intel.com>

The Coverity scan reported (CWE-676):
  rand() should not be used for security-related applications, because
  linear congruential algorithms are too easy to break.

This series of patch replaces the standard random number generation
function, rand(), to getrandom() syscall, which provides more secure
random number than the standard rand() function.

Tedd Ho-Jeong An (5):
  emulator: Replace random number generation function
  peripheral: Replace random number generation function
  tools/btgatt-server: Replace random number generation function
  plugins: Replace random number generation function
  profiles/health: Replace random number generation function

 emulator/le.c          | 11 +++++++++--
 emulator/phy.c         | 10 ++++++++--
 peripheral/main.c      | 11 ++++++-----
 plugins/autopair.c     |  8 +++++++-
 profiles/health/hdp.c  | 11 +++++++----
 profiles/health/mcap.c | 17 +++++++++++++++--
 tools/btgatt-server.c  |  7 ++++++-
 7 files changed, 58 insertions(+), 17 deletions(-)

Comments

Luiz Augusto von Dentz Dec. 9, 2021, 6:45 p.m. UTC | #1
Hi Tedd,

On Wed, Dec 8, 2021 at 5:29 PM Tedd Ho-Jeong An <hj.tedd.an@gmail.com> wrote:
>
> From: Tedd Ho-Jeong An <tedd.an@intel.com>
>
> The Coverity scan reported (CWE-676):
>   rand() should not be used for security-related applications, because
>   linear congruential algorithms are too easy to break.
>
> This series of patch replaces the standard random number generation
> function, rand(), to getrandom() syscall, which provides more secure
> random number than the standard rand() function.
>
> Tedd Ho-Jeong An (5):
>   emulator: Replace random number generation function
>   peripheral: Replace random number generation function
>   tools/btgatt-server: Replace random number generation function
>   plugins: Replace random number generation function
>   profiles/health: Replace random number generation function
>
>  emulator/le.c          | 11 +++++++++--
>  emulator/phy.c         | 10 ++++++++--
>  peripheral/main.c      | 11 ++++++-----
>  plugins/autopair.c     |  8 +++++++-
>  profiles/health/hdp.c  | 11 +++++++----
>  profiles/health/mcap.c | 17 +++++++++++++++--
>  tools/btgatt-server.c  |  7 ++++++-
>  7 files changed, 58 insertions(+), 17 deletions(-)
>
> --
> 2.25.1

Applied, thanks.