| 1 |
/* |
| 2 |
* |
| 3 |
* Licensed to the Apache Software Foundation (ASF) under one |
| 4 |
* or more contributor license agreements. See the NOTICE file |
| 5 |
* distributed with this work for additional information |
| 6 |
* regarding copyright ownership. The ASF licenses this file |
| 7 |
* to you under the Apache License, Version 2.0 (the |
| 8 |
* "License"); you may not use this file except in compliance |
| 9 |
* with the License. You may obtain a copy of the License at |
| 10 |
* |
| 11 |
* http://www.apache.org/licenses/LICENSE-2.0 |
| 12 |
* |
| 13 |
* Unless required by applicable law or agreed to in writing, |
| 14 |
* software distributed under the License is distributed on an |
| 15 |
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 16 |
* KIND, either express or implied. See the License for the |
| 17 |
* specific language governing permissions and limitations |
| 18 |
* under the License. |
| 19 |
* |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef PROTON_SASL_INTERNAL_H |
| 23 |
#define PROTON_SASL_INTERNAL_H 1 |
| 24 |
|
| 25 |
#include "core/buffer.h" |
| 26 |
#include "core/engine-internal.h" |
| 27 |
|
| 28 |
#include "proton/types.h" |
| 29 |
#include "proton/sasl.h" |
| 30 |
#include "proton/sasl_plugin.h" |
| 31 |
|
| 32 |
extern const pnx_sasl_implementation default_sasl_impl; |
| 33 |
extern const pnx_sasl_implementation * const cyrus_sasl_impl; |
| 34 |
|
| 35 |
// SASL APIs used by transport code |
| 36 |
void pn_sasl_free(pn_transport_t *transport); |
| 37 |
void pni_sasl_set_user_password(pn_transport_t *transport, const char *user, const char *authzid, const char *password); |
| 38 |
void pni_sasl_set_remote_hostname(pn_transport_t *transport, const char* fqdn); |
| 39 |
void pni_sasl_set_external_security(pn_transport_t *transport, int ssf, const char *authid); |
| 40 |
|
| 41 |
struct pni_sasl_t { |
| 42 |
void *impl_context; |
| 43 |
const pnx_sasl_implementation* impl; |
| 44 |
char *selected_mechanism; |
| 45 |
char *included_mechanisms; |
| 46 |
const char *username; |
| 47 |
const char *authzid; |
| 48 |
char *password; |
| 49 |
const char *remote_fqdn; |
| 50 |
char *local_fqdn; |
| 51 |
char *external_auth; |
| 52 |
int external_ssf; |
| 53 |
size_t max_encrypt_size; |
| 54 |
pn_buffer_t* decoded_buffer; |
| 55 |
pn_buffer_t* encoded_buffer; |
| 56 |
pn_bytes_t bytes_out; |
| 57 |
pn_sasl_outcome_t outcome; |
| 58 |
enum pnx_sasl_state desired_state; |
| 59 |
enum pnx_sasl_state last_state; |
| 60 |
bool allow_insecure_mechs; |
| 61 |
bool client; |
| 62 |
}; |
| 63 |
|
| 64 |
#endif /* sasl-internal.h */ |