History log of /openbmc/bmcweb/include/ossl_random.hpp (Results 1 – 5 of 5)
Revision Date Author Comments
# b7f3a82b 05-Jun-2024 Ed Tanous <ed@tanous.net>

Break out random ID methods

The method of creating a random ID from an openssl random generator of a
particular length is something that is generally useful, and something
we can write unit tests fo

Break out random ID methods

The method of creating a random ID from an openssl random generator of a
particular length is something that is generally useful, and something
we can write unit tests for. Add it.

Tested:
Redfish service validator login flows work correctly in redfish service
validator.

Change-Id: Ic3b58d33f1421f3eb39e2d57585958f87f6fb8ea
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 17c47245 08-Apr-2024 Ed Tanous <ed@tanous.net>

Move logging args

Args captured by logging functions should be captured by rvalue, and use
std::forward to get perfect forwarding. In addition, separate out the
various std::out lines.

While we're

Move logging args

Args captured by logging functions should be captured by rvalue, and use
std::forward to get perfect forwarding. In addition, separate out the
various std::out lines.

While we're here, also try to optimize a little. We should ideally be
writing each log line to the output once, and ideally not use iostreams,
which induce a lot of overhead.

Similar to spdlog[1] (which at one point this codebase used), construct
the string, then call fwrite and fflush once, rather than calling
std::cout repeatedly.

Now that we don't have a dependency on iostreams anymore, we can remove
it from the places where it has snuck in.

Tested:
Logging still functions as before. Logs present.

[1] https://github.com/gabime/spdlog/blob/27cb4c76708608465c413f6d0e6b8d99a4d84302/include/spdlog/sinks/stdout_sinks-inl.h#L70C7-L70C13

Change-Id: I1dd4739e06eb506d68989a066d122109b71b92cd
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 6dbe9bea 14-Apr-2024 Ed Tanous <ed@tanous.net>

Remove OpenSSL warnings ignore

If we include OpenSSL in extern "C" blocks consistently, c++ warnings no
longer appear. This means we can remove the special case from meson.

Tested: Code compiles w

Remove OpenSSL warnings ignore

If we include OpenSSL in extern "C" blocks consistently, c++ warnings no
longer appear. This means we can remove the special case from meson.

Tested: Code compiles when built locally on an ubuntu 22.04 system.

Change-Id: I5add4113b32cd88b7fdd874174c845425a7c287a
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# c160ae72 27-Mar-2024 Ed Tanous <ed@tanous.net>

Remove old uses of cout/cerr

Most of this code was written before bmcweb had a logger, and
therefore used cout/cerr.

This commit greps the codebase and finds all places where we still
use cout/cerr

Remove old uses of cout/cerr

Most of this code was written before bmcweb had a logger, and
therefore used cout/cerr.

This commit greps the codebase and finds all places where we still
use cout/cerr, and moves them to logging.

Tested: Inspection only. No functional changes.

Change-Id: I5ce1883c9941e80203ec29decb3a0206fd118506
Signed-off-by: Ed Tanous <ed@tanous.net>

show more ...


# 2c6ffdb0 28-Jun-2023 Ed Tanous <edtanous@google.com>

Use openssl random number generator

We already have a generator class. We should use it. Wrap this into a
function that can be unit tested, and add unit tests.

Note, some files also needed to cha

Use openssl random number generator

We already have a generator class. We should use it. Wrap this into a
function that can be unit tested, and add unit tests.

Note, some files also needed to change name, because random.hpp
conflicts with the built in random, and causes circular build problems.
This commit changes it to ossl_random.

Tested: Unit tests pass. Now has coverage.

Redfish service validator passes.

Change-Id: I5f8eee1af5f4843a352c6fd0e26d67fd3320ef53
Signed-off-by: Ed Tanous <edtanous@google.com>

show more ...