]>
Commit | Line | Data |
---|---|---|
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) 2009-2011 New Dream Network | |
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 | #include "AuthNoneAuthorizeHandler.h" | |
16 | #include "common/debug.h" | |
17 | ||
18 | #define dout_subsys ceph_subsys_auth | |
19 | ||
28e407b8 | 20 | bool AuthNoneAuthorizeHandler::verify_authorizer( |
11fdf7f2 TL |
21 | CephContext *cct, |
22 | KeyStore *keys, | |
23 | const bufferlist& authorizer_data, | |
24 | size_t connection_secret_required_len, | |
25 | bufferlist *authorizer_reply, | |
26 | EntityName *entity_name, | |
27 | uint64_t *global_id, | |
28 | AuthCapsInfo *caps_info, | |
29 | CryptoKey *session_key, | |
30 | std::string *connection_secret, | |
28e407b8 | 31 | std::unique_ptr<AuthAuthorizerChallenge> *challenge) |
7c673cae | 32 | { |
11fdf7f2 | 33 | auto iter = authorizer_data.cbegin(); |
7c673cae FG |
34 | |
35 | try { | |
36 | __u8 struct_v = 1; | |
11fdf7f2 TL |
37 | decode(struct_v, iter); |
38 | decode(*entity_name, iter); | |
39 | decode(*global_id, iter); | |
7c673cae FG |
40 | } catch (const buffer::error &err) { |
41 | ldout(cct, 0) << "AuthNoneAuthorizeHandle::verify_authorizer() failed to decode" << dendl; | |
42 | return false; | |
43 | } | |
44 | ||
11fdf7f2 | 45 | caps_info->allow_all = true; |
7c673cae FG |
46 | |
47 | return true; | |
48 | } | |
49 | ||
50 | // Return type of crypto used for this session's data; for none, no crypt used | |
51 | ||
52 | int AuthNoneAuthorizeHandler::authorizer_session_crypto() | |
53 | { | |
54 | return SESSION_CRYPTO_NONE; | |
55 | } |