]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: Use ceph_assert for asserts
authorAdam C. Emerson <aemerson@redhat.com>
Thu, 23 Aug 2018 15:18:15 +0000 (11:18 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Mon, 27 Aug 2018 13:09:01 +0000 (09:09 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/auth/Crypto.h
src/auth/cephx/CephxKeyServer.cc
src/auth/cephx/CephxKeyServer.h
src/auth/cephx/CephxProtocol.cc
src/auth/cephx/CephxProtocol.h

index cc999b0a1a4cb663e858c285c34222b469ef384e..4cda0830343fb18ab26bb6e837d339da985928b5 100644 (file)
@@ -146,12 +146,12 @@ public:
   int create(CephContext *cct, int type);
   int encrypt(CephContext *cct, const bufferlist& in, bufferlist& out,
               std::string *error) const {
-    assert(ckh); // Bad key?
+    ceph_assert(ckh); // Bad key?
     return ckh->encrypt(in, out, error);
   }
   int decrypt(CephContext *cct, const bufferlist& in, bufferlist& out,
               std::string *error) const {
-    assert(ckh); // Bad key?
+    ceph_assert(ckh); // Bad key?
     return ckh->decrypt(in, out, error);
   }
 
@@ -160,12 +160,12 @@ public:
 
   std::size_t encrypt(CephContext*, const in_slice_t& in,
                      const out_slice_t& out) {
-    assert(ckh);
+    ceph_assert(ckh);
     return ckh->encrypt(in, out);
   }
   std::size_t decrypt(CephContext*, const in_slice_t& in,
                      const out_slice_t& out) {
-    assert(ckh);
+    ceph_assert(ckh);
     return ckh->encrypt(in, out);
   }
 
index 38483253d0cd9ce2bad26408805844b9fc86cbbf..8d294ddbcd3499e0ddb560c71a5eb527b849af3e 100644 (file)
@@ -351,7 +351,7 @@ int KeyServer::encode_secrets(Formatter *f, stringstream *ds) const
 
 void KeyServer::encode_formatted(string label, Formatter *f, bufferlist &bl)
 {
-  assert(f != NULL);
+  ceph_assert(f != NULL);
   f->open_object_section(label.c_str());
   encode_secrets(f, NULL);
   f->close_section();
index 2b069c4d32e0853f24e473c86b3e3bb032ef2acd..80a3aa927226b015b9b200728105940594d05203 100644 (file)
@@ -151,7 +151,7 @@ struct KeyServerData {
       __u32 _op;
       decode(_op, bl);
       op = (IncrementalOp)_op;
-      assert(op >= AUTH_INC_NOP && op <= AUTH_INC_SET_ROTATING);
+      ceph_assert(op >= AUTH_INC_NOP && op <= AUTH_INC_SET_ROTATING);
       if (op == AUTH_INC_SET_ROTATING) {
        decode(rotating_bl, bl);
       } else {
index 59254680635e121776c3ce2dcfd8dda1899e0d4a..d815a98c3835f87123ee892b687b36d2c889dd34 100644 (file)
@@ -429,7 +429,7 @@ bool cephx_verify_authorizer(CephContext *cct, KeyStore *keys,
       ldout(cct, 0) << "verify_authorizer could not get service secret for service "
              << ceph_entity_type_name(service_id) << " secret_id=" << ticket.secret_id << dendl;
       if (cct->_conf->auth_debug && ticket.secret_id == 0)
-       assert(0 == "got secret_id=0");
+       ceph_assert(0 == "got secret_id=0");
       return false;
     }
   }
index 16135ec11f31ad6220560e3ccda8d32802d3cb6f..4629bba80add486b9d6cee80b0a5ee55f5f71b6d 100644 (file)
@@ -347,7 +347,7 @@ struct CephXTicketManager {
     CephXTicketHandler newTicketHandler(cct, type);
     std::pair < tickets_map_t::iterator, bool > res =
        tickets_map.insert(std::make_pair(type, newTicketHandler));
-    assert(res.second);
+    ceph_assert(res.second);
     return res.first->second;
   }
   CephXAuthorizer *build_authorizer(uint32_t service_id) const;