]> git.proxmox.com Git - ceph.git/blame - ceph/src/auth/cephx/CephxServiceHandler.h
import ceph 15.2.11
[ceph.git] / ceph / src / auth / cephx / CephxServiceHandler.h
CommitLineData
7c673cae
FG
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#ifndef CEPH_CEPHXSERVICEHANDLER_H
16#define CEPH_CEPHXSERVICEHANDLER_H
17
18#include "auth/AuthServiceHandler.h"
19#include "auth/Auth.h"
20
21class KeyServer;
c5c27e9a
TL
22struct CephXAuthenticate;
23struct CephXServiceTicketInfo;
7c673cae
FG
24
25class CephxServiceHandler : public AuthServiceHandler {
26 KeyServer *key_server;
27 uint64_t server_challenge;
28
29public:
30 CephxServiceHandler(CephContext *cct_, KeyServer *ks)
31 : AuthServiceHandler(cct_), key_server(ks), server_challenge(0) {}
32 ~CephxServiceHandler() override {}
33
11fdf7f2
TL
34 int handle_request(
35 bufferlist::const_iterator& indata,
36 size_t connection_secret_required_length,
37 bufferlist *result_bl,
11fdf7f2
TL
38 AuthCapsInfo *caps,
39 CryptoKey *session_key,
40 std::string *connection_secret) override;
41
c5c27e9a
TL
42private:
43 int do_start_session(bool is_new_global_id,
44 bufferlist *result_bl,
45 AuthCapsInfo *caps) override;
46
47 int verify_old_ticket(const CephXAuthenticate& req,
48 CephXServiceTicketInfo& old_ticket_info,
49 bool& should_enc_ticket);
50 void build_cephx_response_header(int request_type, int status,
51 bufferlist& bl);
7c673cae
FG
52};
53
54#endif