Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 281c98bc authored by William Escande's avatar William Escande
Browse files

uuid: remove GetRandom

As a stack Bluetooth should not have to generate random uuid

Bug: 343550315
Test: None
Flag: Exempt mechanical
Change-Id: I697742b3d98ccd29dd28c8cc7601122b1d584d5a
parent 34195ca0
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -176,12 +176,6 @@ const UUID128Bit& Uuid::To128BitBE() const {
  return uu;
}

Uuid Uuid::GetRandom() {
  Uuid uuid;
  RAND_bytes(uuid.uu.data(), uuid.uu.size());
  return uuid;
}

bool Uuid::IsEmpty() const {
  return *this == kEmpty;
}
+0 −3
Original line number Diff line number Diff line
@@ -68,9 +68,6 @@ class Uuid final : public storage::Serializable<Uuid> {
  std::string ToString() const override;
  std::string ToLegacyConfigString() const override;

  // Creates and returns a random 128-bit UUID.
  static Uuid GetRandom();

  // Returns the shortest possible representation of this UUID in bytes. Either
  // kNumBytes16, kNumBytes32, or kNumBytes128
  size_t GetShortestRepresentationSize() const;
+0 −5
Original line number Diff line number Diff line
@@ -156,11 +156,6 @@ TEST(UuidTest, legacy) {
  ASSERT_EQ(uuid, Uuid::FromLegacyConfigString(UUID_BASE_STR));
}

TEST(UuidTest, random) {
  auto uuid = Uuid::GetRandom();
  ASSERT_TRUE(!uuid.IsEmpty());
}

TEST(UuidTest, inequalities) {
  auto uuid1 = Uuid::kEmpty;
  auto uuid2 = Uuid::FromString("11111111-1111-1111-1111-111111111111");