From bea05159e4239e04dc5e8782b881ed7f70b231fc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 20 Feb 2012 17:03:25 +1100 Subject: s3-libsmb: Remove unused spnego functions --- source3/include/proto.h | 11 ----- source3/libsmb/clispnego.c | 109 --------------------------------------------- 2 files changed, 120 deletions(-) diff --git a/source3/include/proto.h b/source3/include/proto.h index 7adb2c4b58..30fc21615d 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -869,9 +869,6 @@ int spnego_gen_krb5_negTokenInit(TALLOC_CTX *ctx, bool spnego_parse_challenge(TALLOC_CTX *ctx, const DATA_BLOB blob, DATA_BLOB *chal1, DATA_BLOB *chal2); DATA_BLOB spnego_gen_auth(TALLOC_CTX *ctx, DATA_BLOB blob); -bool spnego_parse_auth(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth); -DATA_BLOB spnego_gen_auth_response(TALLOC_CTX *ctx, DATA_BLOB *reply, NTSTATUS nt_status, - const char *mechOID); bool spnego_parse_auth_response(TALLOC_CTX *ctx, DATA_BLOB blob, NTSTATUS nt_status, const char *mechOID, @@ -879,14 +876,6 @@ bool spnego_parse_auth_response(TALLOC_CTX *ctx, bool spnego_parse_auth_and_mic(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth, DATA_BLOB *signature); -DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx, - NTSTATUS nt_status, - const char *mechOID, - DATA_BLOB *reply, - DATA_BLOB *mechlistMIC); -bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx, - char **oid_list, DATA_BLOB *data); - /* The following definitions come from libsmb/conncache.c */ NTSTATUS check_negative_conn_cache( const char *domain, const char *server); diff --git a/source3/libsmb/clispnego.c b/source3/libsmb/clispnego.c index d584f9f4ab..c1b49c9d33 100644 --- a/source3/libsmb/clispnego.c +++ b/source3/libsmb/clispnego.c @@ -449,78 +449,6 @@ done: return true; } -bool spnego_parse_auth(TALLOC_CTX *ctx, DATA_BLOB blob, DATA_BLOB *auth) -{ - return spnego_parse_auth_and_mic(ctx, blob, auth, NULL); -} - -/* - generate a minimal SPNEGO response packet. Doesn't contain much. -*/ -DATA_BLOB spnego_gen_auth_response_and_mic(TALLOC_CTX *ctx, - NTSTATUS nt_status, - const char *mechOID, - DATA_BLOB *reply, - DATA_BLOB *mechlistMIC) -{ - ASN1_DATA *data; - DATA_BLOB ret; - uint8 negResult; - - if (NT_STATUS_IS_OK(nt_status)) { - negResult = SPNEGO_ACCEPT_COMPLETED; - } else if (NT_STATUS_EQUAL(nt_status, NT_STATUS_MORE_PROCESSING_REQUIRED)) { - negResult = SPNEGO_ACCEPT_INCOMPLETE; - } else { - negResult = SPNEGO_REJECT; - } - - data = asn1_init(talloc_tos()); - if (data == NULL) { - return data_blob_null; - } - - asn1_push_tag(data, ASN1_CONTEXT(1)); - asn1_push_tag(data, ASN1_SEQUENCE(0)); - asn1_push_tag(data, ASN1_CONTEXT(0)); - asn1_write_enumerated(data, negResult); - asn1_pop_tag(data); - - if (mechOID) { - asn1_push_tag(data,ASN1_CONTEXT(1)); - asn1_write_OID(data, mechOID); - asn1_pop_tag(data); - } - - if (reply && reply->data != NULL) { - asn1_push_tag(data,ASN1_CONTEXT(2)); - asn1_write_OctetString(data, reply->data, reply->length); - asn1_pop_tag(data); - } - - if (mechlistMIC && mechlistMIC->data != NULL) { - asn1_push_tag(data, ASN1_CONTEXT(3)); - asn1_write_OctetString(data, - mechlistMIC->data, - mechlistMIC->length); - asn1_pop_tag(data); - } - - asn1_pop_tag(data); - asn1_pop_tag(data); - - ret = data_blob_talloc(ctx, data->data, data->length); - asn1_free(data); - return ret; -} - -DATA_BLOB spnego_gen_auth_response(TALLOC_CTX *ctx, DATA_BLOB *reply, - NTSTATUS nt_status, const char *mechOID) -{ - return spnego_gen_auth_response_and_mic(ctx, nt_status, - mechOID, reply, NULL); -} - /* parse a SPNEGO auth packet. This contains the encrypted passwords */ @@ -596,40 +524,3 @@ bool spnego_parse_auth_response(TALLOC_CTX *ctx, return True; } -bool spnego_mech_list_blob(TALLOC_CTX *mem_ctx, - char **oid_list, DATA_BLOB *raw_data) -{ - ASN1_DATA *data; - unsigned int idx; - - if (!oid_list || !oid_list[0] || !raw_data) { - return false; - } - - data = asn1_init(talloc_tos()); - if (data == NULL) { - return false; - } - - asn1_push_tag(data, ASN1_SEQUENCE(0)); - for (idx = 0; oid_list[idx]; idx++) { - asn1_write_OID(data, oid_list[idx]); - } - asn1_pop_tag(data); - - if (data->has_error) { - DEBUG(3, (__location__ " failed at %d\n", (int)data->ofs)); - asn1_free(data); - return false; - } - - *raw_data = data_blob_talloc(mem_ctx, data->data, data->length); - if (!raw_data->data) { - DEBUG(3, (__location__": data_blob_talloc() failed!\n")); - asn1_free(data); - return false; - } - - asn1_free(data); - return true; -} -- cgit