Fix some bugs when testing opensds ansible
[stor4nfv.git] / src / ceph / src / auth / cephx / CephxSessionHandler.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- 
2 // vim: ts=8 sw=2 smarttab
3 /*
4  * Ceph - scalable distributed file system
5  *
6  * Copyright (C) 2004-2009 Sage Weil <sage@newdream.net>
7  *
8  * This is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License version 2.1, as published by the Free Software 
11  * Foundation.  See file COPYING.
12  * 
13  */
14
15
16 #include "auth/AuthSessionHandler.h"
17 #include "auth/Auth.h"
18
19 class CephContext;
20 class Message;
21
22 class CephxSessionHandler  : public AuthSessionHandler {
23   uint64_t features;
24
25 public:
26   CephxSessionHandler(CephContext *cct_, CryptoKey session_key, uint64_t features)
27     : AuthSessionHandler(cct_, CEPH_AUTH_CEPHX, session_key),
28       features(features) {}
29   ~CephxSessionHandler() override {}
30   
31   bool no_security() override {
32     return false;
33   }
34
35   int _calc_signature(Message *m, uint64_t *psig);
36
37   int sign_message(Message *m) override;
38   int check_message_signature(Message *m) override ;
39
40   // Cephx does not currently encrypt messages, so just return 0 if called.  PLR
41
42   int encrypt_message(Message *m) override {
43     return 0;
44   }
45
46   int decrypt_message(Message *m) override {
47     return 0;
48   }
49
50 };
51