The AuthAuthorizer encoding always begins with byte 0x01. Codify that
as AUTH_MODE_AUTHORIZER so that we can distinguish an authorizer from
something else (e.g., an attempt to authenticate and get an initial auth
ticket with the mon).
Signed-off-by: Sage Weil <sage@redhat.com>
#include "Crypto.h"
#include "common/entity_name.h"
+enum {
+ AUTH_MODE_AUTHORIZER = 1,
+ AUTH_MODE_MON = 100,
+};
+
class Cond;
struct EntityAuth {
a->session_key = session_key;
cct->random()->get_bytes((char*)&a->nonce, sizeof(a->nonce));
- __u8 authorizer_v = 1;
+ __u8 authorizer_v = 1; // see AUTH_MODE_* in Auth.h
encode(authorizer_v, a->bl);
encode(global_id, a->bl);
encode(service_id, a->bl);
struct AuthNoneAuthorizer : public AuthAuthorizer {
AuthNoneAuthorizer() : AuthAuthorizer(CEPH_AUTH_NONE) { }
bool build_authorizer(const EntityName &ename, uint64_t global_id) {
- __u8 struct_v = 1;
+ __u8 struct_v = 1; // see AUTH_MODE_* in Auth.h
encode(struct_v, bl);
encode(ename, bl);
encode(global_id, bl);
struct AuthUnknownAuthorizer : public AuthAuthorizer {
AuthUnknownAuthorizer() : AuthAuthorizer(CEPH_AUTH_UNKNOWN) { }
bool build_authorizer(const EntityName &ename, uint64_t global_id) {
- __u8 struct_v = 1;
+ __u8 struct_v = 1; // see AUTH_MODE_* in Auth.h
encode(struct_v, bl);
encode(ename, bl);
encode(global_id, bl);