]>
Commit | Line | Data |
---|---|---|
11fdf7f2 | 1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
7c673cae FG |
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 | |
11fdf7f2 | 10 | * License version 2.1, as published by the Free Software |
7c673cae | 11 | * Foundation. See file COPYING. |
11fdf7f2 | 12 | * |
7c673cae FG |
13 | */ |
14 | ||
15 | ||
16 | #ifndef CEPH_AUTHSESSIONHANDLER_H | |
17 | #define CEPH_AUTHSESSIONHANDLER_H | |
18 | ||
19 | #include "include/types.h" | |
20 | #include "Auth.h" | |
21 | ||
22 | #define SESSION_SIGNATURE_FAILURE -1 | |
23 | ||
24 | // Defines the security applied to ongoing messages in a session, once the session is established. PLR | |
25 | ||
26 | class CephContext; | |
7c673cae FG |
27 | class Message; |
28 | ||
29 | struct AuthSessionHandler { | |
11fdf7f2 | 30 | virtual ~AuthSessionHandler() = default; |
7c673cae FG |
31 | virtual int sign_message(Message *message) = 0; |
32 | virtual int check_message_signature(Message *message) = 0; | |
11fdf7f2 | 33 | }; |
7c673cae | 34 | |
11fdf7f2 TL |
35 | struct DummyAuthSessionHandler : AuthSessionHandler { |
36 | int sign_message(Message*) final { | |
37 | return 0; | |
38 | } | |
39 | int check_message_signature(Message*) final { | |
40 | return 0; | |
41 | } | |
7c673cae FG |
42 | }; |
43 | ||
11fdf7f2 TL |
44 | struct DecryptionError : public std::exception {}; |
45 | ||
46 | extern AuthSessionHandler *get_auth_session_handler( | |
47 | CephContext *cct, int protocol, | |
48 | const CryptoKey& key, | |
49 | uint64_t features); | |
7c673cae FG |
50 | |
51 | #endif |