]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: audit memset & bzero users for FIPS.
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 15 Nov 2019 23:41:13 +0000 (00:41 +0100)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 11 Dec 2019 00:11:12 +0000 (01:11 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
(cherry picked from commit cdfc5cded9db88c59fc8e9b5dcee0a0fb1f9272a)

src/rgw/rgw_civetweb_frontend.cc
src/rgw/rgw_common.cc
src/rgw/rgw_file.h
src/rgw/rgw_http_client.cc
src/rgw/rgw_ldap.cc
src/rgw/rgw_swift_auth.cc
src/rgw/rgw_torrent.cc

index 18aedede0f2dbc4f5b5dbe5dba7d26fcdfc1e662..4e9d1ce74fe7907d03d64921c97a48107e9c1864 100644 (file)
@@ -142,6 +142,7 @@ int RGWCivetWebFrontend::run()
   options.push_back(nullptr);
   /* Initialize the CivetWeb right now. */
   struct mg_callbacks cb;
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset((void *)&cb, 0, sizeof(cb));
   cb.begin_request = civetweb_callback;
   cb.log_message = rgw_civetweb_log_callback;
index e8a6438daecea772905c14ee59e935fd559255b4..fffc1b289cb5f8a9aa255d67d21fac62bddb1185 100644 (file)
@@ -475,24 +475,28 @@ static bool check_gmt_end(const char *s)
 
 static bool parse_rfc850(const char *s, struct tm *t)
 {
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset(t, 0, sizeof(*t));
   return check_gmt_end(strptime(s, "%A, %d-%b-%y %H:%M:%S ", t));
 }
 
 static bool parse_asctime(const char *s, struct tm *t)
 {
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset(t, 0, sizeof(*t));
   return check_str_end(strptime(s, "%a %b %d %H:%M:%S %Y", t));
 }
 
 static bool parse_rfc1123(const char *s, struct tm *t)
 {
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset(t, 0, sizeof(*t));
   return check_gmt_end(strptime(s, "%a, %d %b %Y %H:%M:%S ", t));
 }
 
 static bool parse_rfc1123_alt(const char *s, struct tm *t)
 {
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset(t, 0, sizeof(*t));
   return check_str_end(strptime(s, "%a, %d %b %Y %H:%M:%S %z", t));
 }
@@ -504,6 +508,7 @@ bool parse_rfc2616(const char *s, struct tm *t)
 
 bool parse_iso8601(const char *s, struct tm *t, uint32_t *pns, bool extended_format)
 {
+  // FIPS zeroization audit 20191115: this memset is not security related.
   memset(t, 0, sizeof(*t));
   const char *p;
 
@@ -1445,6 +1450,7 @@ class HexTable
 
 public:
   HexTable() {
+    // FIPS zeroization audit 20191115: this memset is not security related.
     memset(table, -1, sizeof(table));
     int i;
     for (i = '0'; i<='9'; i++)
index f9cebc02e33b9e589ba055891c2d53a4e5fc464e..84b17069e20f4829f919115547a57ca03f276cca 100644 (file)
@@ -438,6 +438,8 @@ namespace rgw {
 
     int stat(struct stat* st, uint32_t flags = FLAG_NONE) {
       /* partial Unix attrs */
+      /* FIPS zeroization audit 20191115: this memset is not security
+       * related. */
       memset(st, 0, sizeof(struct stat));
       st->st_dev = state.dev;
       st->st_ino = fh.fh_hk.object; // XXX
index bb68c1450ce1b40ab411090e36d41fc88715837d..bb14e03fd3336a5010d60e10eba0469193a5b930 100644 (file)
@@ -52,6 +52,7 @@ struct rgw_http_req_data : public RefCountedObject {
   std::unique_ptr<Completion> completion;
 
   rgw_http_req_data() : id(-1), lock("rgw_http_req_data::lock") {
+    // FIPS zeroization audit 20191115: this memset is not security related.
     memset(error_buf, 0, sizeof(error_buf));
   }
 
index 91106a1156e75db35aa93c06b0245ff41a22d25a..9e7156fc52bd6f1907ee964c10df949d5aad1715 100644 (file)
@@ -23,6 +23,8 @@ std::string parse_rgw_ldap_bindpw(CephContext* ctx)
       << __func__ << " LDAP auth no rgw_ldap_secret file found in conf"
       << dendl;
     } else {
+      // FIPS zeroization audit 20191116: this memset is not intended to
+      // wipe out a secret after use.
       char bindpw[1024];
       memset(bindpw, 0, 1024);
       int pwlen = safe_read_file("" /* base */, ldap_secret.c_str(),
index dcd6758f3e90171485e0b9848b509a40edf589d9..207c8eaad45ca49fa3b7f08e4f5f54bd0c0a5ccf 100644 (file)
@@ -475,6 +475,8 @@ static int build_token(const string& swift_user,
   dout(20) << "build_token token=" << buf << dendl;
 
   char k[CEPH_CRYPTO_HMACSHA1_DIGESTSIZE];
+  // FIPS zeroization audit 20191116: this memset is not intended to
+  // wipe out a secret after use.
   memset(k, 0, sizeof(k));
   const char *s = key.c_str();
   for (int i = 0; i < (int)key.length(); i++, s++) {
index c8786ee9a7ed19335e3150db6b387dced6c8695a..57c3f944c3fb65e61593747e84312bde77ad2ee2 100644 (file)
@@ -154,6 +154,8 @@ void seed::sha1(SHA1 *h, bufferlist &bl, off_t bl_len)
   /* get sha1 */
   for (off_t i = 0; i < num; i++)
   {
+    // FIPS zeroization audit 20191116: this memset is not intended to
+    // wipe out a secret after use.
     memset(sha, 0x00, sizeof(sha));
     h->Update((unsigned char *)pstr, info.piece_length);
     h->Final((unsigned char *)sha);
@@ -164,6 +166,8 @@ void seed::sha1(SHA1 *h, bufferlist &bl, off_t bl_len)
   /* process remain */
   if (0 != remain)
   {
+    // FIPS zeroization audit 20191116: this memset is not intended to
+    // wipe out a secret after use.
     memset(sha, 0x00, sizeof(sha));
     h->Update((unsigned char *)pstr, remain);
     h->Final((unsigned char *)sha);