1/* 2 * Copyright (c) 2006 Kungliga Tekniska Högskolan 3 * (Royal Institute of Technology, Stockholm, Sweden). 4 * All rights reserved. 5 * 6 * Portions Copyright (c) 2009 Apple Inc. All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 12 * 1. Redistributions of source code must retain the above copyright 13 * notice, this list of conditions and the following disclaimer. 14 * 15 * 2. Redistributions in binary form must reproduce the above copyright 16 * notice, this list of conditions and the following disclaimer in the 17 * documentation and/or other materials provided with the distribution. 18 * 19 * 3. Neither the name of the Institute nor the names of its contributors 20 * may be used to endorse or promote products derived from this software 21 * without specific prior written permission. 22 * 23 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * SUCH DAMAGE. 34 */ 35 36#include "gssdigest.h" 37 38#ifdef ENABLE_SCRAM 39 40static gssapi_mech_interface_desc scram_mech = { 41 GMI_VERSION, 42 "SCRAM-SHA1", 43 {6, (void *)"\x2b\x06\x01\x05\x05\x0e"}, 44 0, 45 _gss_scram_acquire_cred, 46 _gss_scram_release_cred, 47 _gss_scram_init_sec_context, 48 _gss_scram_accept_sec_context, 49 _gss_scram_process_context_token, 50 _gss_scram_delete_sec_context, 51 _gss_scram_context_time, 52 NULL, /* get_mic */ 53 NULL, /* verify_mic */ 54 NULL, /* wrap */ 55 NULL, /* unwrap */ 56 _gss_scram_display_status, 57 NULL, 58 _gss_scram_compare_name, 59 _gss_scram_display_name, 60 _gss_scram_import_name, 61 _gss_scram_export_name, 62 _gss_scram_release_name, 63 _gss_scram_inquire_cred, 64 _gss_scram_inquire_context, 65 NULL, /* wrap_size_limit */ 66 _gss_scram_add_cred, 67 _gss_scram_inquire_cred_by_mech, 68 _gss_scram_export_sec_context, 69 _gss_scram_import_sec_context, 70 _gss_scram_inquire_names_for_mech, 71 _gss_scram_inquire_mechs_for_name, 72 _gss_scram_canonicalize_name, 73 _gss_scram_duplicate_name, 74 _gss_scram_inquire_sec_context_by_oid, 75 NULL, 76 NULL, 77 NULL, 78 NULL, 79 NULL, /* wrap_iov */ 80 NULL, /* unwrap_iov */ 81 NULL, /* wrap_iov_length */ 82 NULL, 83 NULL, 84 NULL, 85 _gss_scram_acquire_cred_ext, 86 _gss_scram_iter_creds_f, 87 _gss_scram_destroy_cred, 88 NULL, 89 NULL, 90 NULL, 91 NULL, 92 NULL, 93 0 94}; 95 96#endif 97 98gssapi_mech_interface 99__gss_scram_initialize(void) 100{ 101#ifdef ENABLE_SCRAM 102 return &scram_mech; 103#else 104 return NULL; 105#endif 106} 107