| 26 | |
| 27 | |
| 28 | AuthSessionHandler *get_auth_session_handler( |
| 29 | CephContext *cct, int protocol, |
| 30 | const CryptoKey& key, |
| 31 | uint64_t features) |
| 32 | { |
| 33 | |
| 34 | // Should add code to only print the SHA1 hash of the key, unless in secure debugging mode |
| 35 | #ifndef WITH_CRIMSON |
| 36 | ldout(cct,10) << "In get_auth_session_handler for protocol " << protocol << dendl; |
| 37 | #endif |
| 38 | switch (protocol) { |
| 39 | case CEPH_AUTH_CEPHX: |
| 40 | // if there is no session key, there is no session handler. |
| 41 | if (key.get_type() == CEPH_CRYPTO_NONE) { |
| 42 | return nullptr; |
| 43 | } |
| 44 | return new CephxSessionHandler(cct, key, features); |
| 45 | case CEPH_AUTH_NONE: |
| 46 | return new AuthNoneSessionHandler(); |
| 47 | #ifdef HAVE_GSSAPI |
| 48 | case CEPH_AUTH_GSS: |
| 49 | return new KrbSessionHandler(); |
| 50 | #endif |
| 51 | default: |
| 52 | return nullptr; |
| 53 | } |
| 54 | } |
| 55 |
no test coverage detected