]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
keyring: drop binary encoder
authorSage Weil <sage@inktank.com>
Wed, 16 May 2012 21:02:26 +0000 (14:02 -0700)
committerSage Weil <sage@inktank.com>
Wed, 16 May 2012 23:36:53 +0000 (16:36 -0700)
Drop the keyring encode method, and binary encoder.

Don't just encode in plaintext because we assume we get the whole
bufferlist, and encoding something like list<KeyRing> would thus fail.

Fixes: #2435
Signed-off-by: Sage Weil <sage@inktank.com>
src/auth/KeyRing.h

index cfac054b28f8680355a2418b82cc5d42eef4178e..44a657c70d9a66b22527714b4739c24b914803ca 100644 (file)
@@ -71,15 +71,16 @@ public:
   void import(CephContext *cct, KeyRing& other);
 
   // encoders
-  void encode(bufferlist& bl) const {
-    __u8 struct_v = 1;
-    ::encode(struct_v, bl);
-    ::encode(keys, bl);
-  }
   void decode(bufferlist::iterator& bl);
 
   void encode_plaintext(bufferlist& bl);
 };
-WRITE_CLASS_ENCODER(KeyRing)
+
+// don't use WRITE_CLASS_ENCODER macro because we don't have an encode
+// macro.  don't juse encode_plaintext in that case because it is not
+// wrappable; it assumes it gets the entire bufferlist.
+static inline void decode(KeyRing& kr, bufferlist::iterator& p) {
+  kr.decode(p);
+}
 
 #endif