]> git.proxmox.com Git - ceph.git/blame - ceph/src/auth/AuthSessionHandler.h
import 15.2.0 Octopus source
[ceph.git] / ceph / src / auth / AuthSessionHandler.h
CommitLineData
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
9f95a23c 19#include "include/common_fwd.h"
7c673cae
FG
20#include "include/types.h"
21#include "Auth.h"
22
23#define SESSION_SIGNATURE_FAILURE -1
24
25// Defines the security applied to ongoing messages in a session, once the session is established. PLR
26
7c673cae
FG
27class Message;
28
29struct 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
35struct 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
44struct DecryptionError : public std::exception {};
45
46extern AuthSessionHandler *get_auth_session_handler(
47 CephContext *cct, int protocol,
48 const CryptoKey& key,
49 uint64_t features);
7c673cae
FG
50
51#endif