EGEE is a project funded by the European Union under contract IST-2003-508833 Authentication and Authorization in LCG-2 Flavia Donno Section Leader for.

Slides:



Advertisements
Similar presentations
Introduction of Grid Security
Advertisements

Security Protocols Sathish Vadhiyar Sources / Credits: Kerberos web pages and documents contained / pointed.
Public Key Infrastructure A Quick Look Inside PKI Technology Investigation Center 3/27/2002.
Spring 2000CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
SSL Implementation Guide Onno W. Purbo
Grid Computing, B. Wilkinson, 20045a.1 Security Continued.
Grid Security Infrastructure Tutorial Von Welch Distributed Systems Laboratory U. Of Chicago and Argonne National Laboratory.
Lecture 2: Security Rachana Ananthakrishnan Argonne National Lab.
SSL & SharePoint IT:Network:Applications. Agenda Secure Socket Layer Encryption 101 SharePoint Customization SharePoint Integration.
Security on Grid: Simone Campana LCG Experiment Integration and Support CERN-IT / INFN-CNAF.
Public Key Infrastructure (PKI) Providing secure communications and authentication over an open network.
Security on Grid Roberto Barbera Univ. of Catania and INFN
Kerberos and PKI Cooperation Daniel Kouřil, Luděk Matyska, Michal Procházka Masaryk University AFS & Kerberos Best Practices Workshop 2006.
Security NeSC Training Team International Summer School for Grid Computing, Vico Equense,
INFSO-RI Enabling Grids for E-sciencE Security, Authorisation and Authentication Mike Mineter Training, Outreach and Education National.
An Introduction to Security Concepts and Public Key Infrastructure (PKI) Mary Thompson.
Summer School Certificates Diego Romano & Gilda Team.
BY MUKTADIUR RAHMAN MAY 06, 2010 INTERODUCTION TO CRYPTOGRAPHY.
Symmetric Key Distribution Protocol with Hybrid Crypto Systems Tony Nguyen.
Presented by Xiaoping Yu Cryptography and PKI Cosc 513 Operating System Presentation Presented to Dr. Mort Anvari.
Security Mechanisms The European DataGrid Project Team
Spring 2003CS 4611 Security Outline Encryption Algorithms Authentication Protocols Message Integrity Protocols Key Distribution Firewalls.
03 December 2003 Public Key Infrastructure and Authentication Mark Norman DCOCE Oxford University Computing Services.
TrustPort Public Key Infrastructure. Keep It Secure Table of contents  Security of electronic communications  Using asymmetric cryptography.
Digital Signature Xiaoyan Guo/ Xiaohang Luo/
Controller of Certifying Authorities PKI Technology - Role of CCA Assistant Controller (Technology) Controller of Certifying Authorities Ministry of Communications.
INTRODUCTION Why Signatures? A uthenticates who created a document Adds formality and finality In many cases, required by law or rule Digital Signatures.
CSCI 6962: Server-side Design and Programming
.Net Security and Performance -has security slowed down the application By Krishnan Ganesh Madras.
SSL / TLS in ITDS Arun Vishwanathan 23 rd Dec 2003.
Cryptography Encryption/Decryption Franci Tajnik CISA Franci Tajnik.
Unit 1: Protection and Security for Grid Computing Part 2
Grid Security 1. Grid security is a crucial component Need for secure communication between grid elements  Authenticated ( verify entities are who they.
Security APIs in LCG-2 Andrea Sciabà LCG Experiment Integration and Support CERN IT.
Certificate-Based Operations. Module Objectives By the end of this module participants will be able to: Define how cryptography is used to secure information.
EGEE is a project funded by the European Union under contract IST EGEE Usage and Programming Introduction Flavia Donno Section Leader for LCG.
INFSO-RI Enabling Grids for E-sciencE Sofia, 22 March 2007 Security, Authentication and Authorisation Mike Mineter Training, Outreach.
E-science grid facility for Europe and Latin America E2GRIS1 Raúl Priego Martínez – CETA-CIEMAT (Spain)‏ Itacuruça (Brazil), 2-15 November.
Advanced Database Course (ESED5204) Eng. Hanan Alyazji University of Palestine Software Engineering Department.
3-Jul-02D.P.Kelsey, Security1 Security meetings Report to EDG PTB 3 Jul 2002 David Kelsey CLRC/RAL, UK
Security Mechanisms The European DataGrid Project Team
Security on Grid: User Interface, Internals and APIs Simone Campana LCG Experiment Integration and Support CERN IT.
23-Oct-02D.P.Kelsey, Grid Security, HEPiX, FNAL1 LCG/EDG Security - update and plans HEPiX/HEPNT - FNAL 23 Oct 2002 David Kelsey CLRC/RAL, UK
Security fundamentals Topic 5 Using a Public Key Infrastructure.
Authorisation, Authentication and Security Guy Warner NeSC Training Team Induction to Grid Computing and the EGEE Project, Vilnius,
Services Security A. Casajus R. Graciani. 12/12/ Overview DIRAC Security Infrastructure HSGE Transport Authentication Authorization DIRAC Authorization.
Security Mechanisms The European DataGrid Project Team
8-Mar-01D.P.Kelsey, Certificates, WP6, Amsterdam1 WP6: Certificates for DataGrid Testbeds David Kelsey CLRC/RAL, UK
Induction: Security and Certification –April 26-28, Security and Certification; Authentication and Authorisation John Kewley EGEE is funded by.
Security on Grid: User Interface, Internals and APIs Simone Campana LCG Experiment Integration and Support CERN IT.
April 20023CSG11 Electronic Commerce Authentication John Wordsworth Department of Computer Science The University of Reading Room.
15-May-03D.P.Kelsey, SCG Summary1 Security Coord Group (SCG) EDG Barcelona, 12 May 2003 David Kelsey CCLRC/RAL, UK
Security in WLCG/EGEE. Security – January Requirements Providers of resources (computers, storages, databases, services..) need risks to.
EGI-InSPIRE RI Grid Training for Power Users EGI-InSPIRE N G I A E G I S Grid Training for Power Users Institute of Physics Belgrade.
1 Grid Security Jinny Chien Academia Sinica Computing Centre Deployment team.
X509 Web Authentication From the perspective of security or An Introduction to Certificates.
EGEE-II INFSO-RI Enabling Grids for E-sciencE Authentication, Authorisation and Security Mike Mineter, National e-Science Centre.
EGEE-II INFSO-RI Enabling Grids for E-sciencE Authentication, Authorisation and Security Emidio Giorgio INFN Catania.
CRYPTOGRAPHY Cryptography is art or science of transforming intelligible message to unintelligible and again transforming that message back to the original.
INFSO-RI Enabling Grids for E-sciencE Sofia, 17 March 2009 Security, Authentication and Authorisation Mike Mineter Training, Outreach.
Security Mechanisms The European DataGrid Project Team
Authentication, Authorisation and Security
Authorization and Authentication in gLite
Grid Security Jinny Chien Academia Sinica Grid Computing.
Update on EDG Security (VOMS)
The EU DataGrid Security Services
The EU DataGrid Security Services
Presentation transcript:

EGEE is a project funded by the European Union under contract IST Authentication and Authorization in LCG-2 Flavia Donno Section Leader for LCG Experiment Integration and Support CERN IT Biomed Application Developer’s Course 6 th October

EGEE Usage and Programming Introduction – October 6, Goals of this module and Overview Describe … Security basics – Public/Private Keys in action Use of Certificates Importance of Certificate Authorities Virtual Organizations Main commands and Globus GSS-API

EGEE Usage and Programming Introduction – October 6, Introduction to Security What aspects of security should we be concerned about? Authentication (Identification) Confidentiality (Privacy) Integrity (non-Tampering) Authorisation Also Accounting Delegation Non-Repudiation

EGEE Usage and Programming Introduction – October 6, Tools of the trade Encryption Secret “symmetric” key – both parties need to share the key (Kerberos) DES, RC4 Comparatively efficient Public/private key – “asymmetric” - 2 keys mathematically related RSA, DSA Slower Oneway hash / message digest MD5, SHA-1 Fast The Grid Security Infrastructure (GSI) uses public key cryptography (also known as asymetric cryptography) as the basis for its functionality. GSI uses SSL/TLS

EGEE Usage and Programming Introduction – October 6, Encrypting for Confidentiality Sending a message using asymmetric keys 1.Encrypt message using Receiver’s public key 2.Send encrypted message 3.Receiver decrypts message using own private key Only someone with Receiver’s private key can decrypt message Sender space Receiver spacePublic space Hello World Receiver’s Public Key Public Key Private Key Receiver’s Public Key openssl hR3a rearj openssl Hello World 2 1 3

EGEE Usage and Programming Introduction – October 6, Signing for Authentication 1.Encrypt message with Sender’s private key. 2.Send encrypted message. 3.Message is readable by ANYONE with Sender’s public key. 4.Receiver decrypts message with Sender’s public key. Receiver can be confident that only someone with Sender’s private key could have sent the message. Sender space Receiver space Public space Hello World Sender’s Public Key openssl n52krj rer openssl Hello World Public KeyPrivate Key Sender’s Public Key openssl Hello World

EGEE Usage and Programming Introduction – October 6, Certificates A statement from someone else (the Certificate Authority), that your public key (and hence your private key) is associated with your identity A certificate can be checked if you have the public key of the party who signed it For a list of all EGEE CAs, please check: CA’s Armenia Belgium Canada CERN CNRS - France (3) CyprusCA’s CESNET - CZ Germany Greece Ireland Israel NIKHEFCA’s NorduGrid Pakistan Poland Portugal Russia SlovakiaCA’s Spain Taiwan United Kingdom US DOE US Esnet US FNAL

EGEE Usage and Programming Introduction – October 6, Certificate Authority A Certificate Authority (CA) issues you your certificates. By signing them it is able to vouch for you to third parties In return for this service, you must provide appropriate documentary evidence of identity when you apply for a certificate through a Registration Authority (RA)

EGEE Usage and Programming Introduction – October 6, Certificate contents The certificate that you present to others contains: Your distinguished name (DN) Your public key The identity of the CA who issued the certificate Its expiry date Digital signature of the CA which issued it Grid Services and Hosts can have certificates

EGEE Usage and Programming Introduction – October 6, Certificate contents You must have a valid certificate from a trusted CA! Certificate Info: grid-cert-info „login”: grid-proxy-init short lifetime certificate: 24 hours Enter PEM pass phrase: openssl x509 –in /tmp/x509up_u`id -u` -text checking the proxy: grid-proxy-info -subject /O=Grid/O=CERN/OU=cern.ch/CN=Flavia Donno/CN=proxy „logout”: grid-proxy-destroy -> use the grid services

EGEE Usage and Programming Introduction – October 6, Still on Certificates What kind of key does grid-cert-request generate ? What is the openssl command to get details about a request ? Check the following: openssl rsa -in ~/.globus/userkey.pem –text What is X509 ? - Check: openssl x509 –in ~/.globus/usercert.pem –text What is in: /etc/grid-security/certificates ?

EGEE Usage and Programming Introduction – October 6, The role of a Virtual Organization A Virtual Organization identifies a group of people and/or resources that share the same working environment Access to certain resources is guaranteed only via registration to a specific VO. A list of supported VOs can be found here: Resources are configured to serve specific VOs

EGEE Usage and Programming Introduction – October 6, Authorization Information The role of a Virtual Organization CA VO-LDAP user service proxy-cert grid-proxy-init registration cert.pkcs12 convert cert-request grid-cert-request certificate cert signing host-cert cert signing gridmap mkgridmap host-request grid-cert-request ca-certificate crl cert/crl update automatically updated every night/week

EGEE Usage and Programming Introduction – October 6, Security APIs For the moment no LCG/EGEE APIs Main Contribution comes from Globus. The GSS Assist code provides convenience functions for using the Globus GSS-API. – Poor documentation Technology dependent APIs: many GSS implementations Some development is under way. Check CHEP 2004:

EGEE Usage and Programming Introduction – October 6, GSS-API The client initiate a context and prepares a token for the server The token is sent to the server The server interprets the token and prepares a new one to be sent to the client The token is sent to the client Iterate process until authentication process successes or fails The client wraps a message for the server and sends it The server receives the message and unwraps it The server sends a confirmation message to the client (MIC) The client verifies the MIC

EGEE Usage and Programming Introduction – October 6, Client GSS-API 1) Client can use default credentials or obtain new ones with: OM_uint32 gss_acquire_cred ( OM_uint32 *minor_status, const gss_name_t desired_name, #name of the principal OM_uint32 time_req, #time validity of credential const gss_OID_set desired_mechs,#...suggest: to use default gss_cred_usage_t cred_usage,#how cred should be used gss_cred_id_t *output_cred_handle, #handler for generated cred. gss_OID_set *actual_mechs,#...suggest: use default OM_uint32 *time_rec) 2) Import the name of the server into GSS-API internal format with: OM_uint32 gss_import_name ( OM_uint32 *minor_status, const gss_buffer_t input_name_buffer,#name to be imported const gss_OID input_name_type,#format of input buffer gss_name_t *output_name) #imported name

EGEE Usage and Programming Introduction – October 6, Client GSS-API Initiate a context: 3) Initiate a context: do do{ OM_uint32 maj_status = gss_init_sec_context ( OM_uint32 *minor_status, const gss_cred_id_t initiator_cred_handle,#could also be def. cred. gss_ctx_id_t *context_handle,#context handler returned const gss_name_t target_name,#principal to connect to const gss_OID mech_type,#mechanism (could be def.) OM_uint32 req_flags, OM_uint32 time_req, Const gss_channel_bindings_t input_chan_bindings, const gss_buffer_t input_token#token received gss_OID *actual_mech_type, gss_buffer_t output_token,#token to be sent OM_uint32 *ret_flags, OM_uint32 *time_rec)  Send the token to the other party (how you do that is not a GSS-API issue) while } while (maj_stat == GSS_S_CONTINUE_NEEDED);

EGEE Usage and Programming Introduction – October 6, Client GSS-API encrypt the message to sent to the server : 4) Once the context is established, encrypt the message to sent to the server : OM_uint32 gss_wrap ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, int conf_req_flag, #confidentiality & integrity gss_qop_t qop_req #quality of protetion const gss_buffer_t input_mess_buffer, #input message int *conf_state, gss_buffer_t output_mess_buffer )#encrypted message  Send the buffer (message) to the other party  Get the MIC from the other party Verify the MIC: 5) Verify the MIC: OM_uint32 gss_verify_mic ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_buffer_tmessage_buffer,#message previously sent const gss_buffer_t token_buffer,#received MIC gss_qop_t qop_state)# quality of protection

EGEE Usage and Programming Introduction – October 6, Server GSS-API 1)Server obtains gss_acquire_cred 1)Server obtains credentials with gss_acquire_cred (can also use the default credentials) Accept context: 2) Accept context:  Get token from the client. do do{ OM_uint32 maj_status = gss_accept_sec_context ( OM_uint32 *minor_status, gss_ctx_id_t *context_handle, const gss_cred_id_t acceptor_cred_handle, const gss_buffer_t input_token_buffer, const gss_channel_bindings_t input_chan_bindings, const gss_name_t *src_name, gss_OID *mech_type, gss_buffer_t output_token, OM_uint32 *ret_flags, OM_uint32 *time_req, gss_cred_id_t *delegated_cred_handle) while } while (maj_stat == GSS_S_CONTINUE_NEEDED);

EGEE Usage and Programming Introduction – October 6, Server GSS-API decrypt it: 3) Once the context is established, get message from the client and decrypt it: OM_uint32 gss_unwrap ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, const gss_buffer_t input_message_buffer, #wrapped message gss_buffer_t output_mess_buffer, #unwrapped message int *conf_state, gss_qop_t *qop_state) Prepare a MIC 4) Prepare a MIC to send back to the client: OM_uint32 gss_get_mic ( OM_uint32 *minor_status, const gss_ctx_id_t context_handle, gss_qop_t qop_req, const gss_buffer_t message_buffer,#message to be tagged gss_buffer_t msg_token) #token with msg & its MIC -> Send the MIC (token) to the client

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage #include #include "globus_gss_assist.h" #include "gssapi_openssl.h" void globus_print_error( globus_result_t error_result); int main() { […] /* Initialize variables */ token_ptr = GSS_C_NO_BUFFER; init_context = GSS_C_NO_CONTEXT; accept_context = GSS_C_NO_CONTEXT; del_init_context = GSS_C_NO_CONTEXT; del_accept_context = GSS_C_NO_CONTEXT; delegated_cred = GSS_C_NO_CREDENTIAL; accept_maj_stat = GSS_S_CONTINUE_NEEDED; ret_flags = 0; […] /* acquire the credential */ maj_stat = gss_acquire_cred(&min_stat, NULL, GSS_C_INDEFINITE, GSS_C_NO_OID_SET, GSS_C_BOTH, &cred_handle, NULL, NULL); OM_uint32 init_maj_stat; OM_uint32 accept_maj_stat; OM_uint32 maj_stat; OM_uint32 min_stat; OM_uint32 ret_flags; OM_uint32 time_rec; gss_buffer_desc send_tok; gss_buffer_desc recv_tok; gss_buffer_desc * token_ptr; gss_buffer_desc oid_buffer; gss_buffer_set_desc oid_buffers; gss_buffer_set_t inquire_buffers; gss_OID mech_type; gss_OID_set_desc oid_set; gss_name_t target_name; gss_ctx_id_t init_context; gss_ctx_id_t accept_context; gss_ctx_id_desc * init_context_handle; gss_ctx_id_t del_init_context; gss_ctx_id_t del_accept_context; gss_cred_id_t delegated_cred;

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage if(maj_stat != GSS_S_COMPLETE) { globus_gss_assist_display_status_str(&error_str, NULL, maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } /* get the subject name */ maj_stat = gss_inquire_cred(&min_stat, cred_handle, &target_name, NULL, NULL); if(maj_stat != GSS_S_COMPLETE) { globus_gss_assist_display_status_str(&error_str, NULL, maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } Globus GSS Assist

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage /* set up the first security context */ init_maj_stat = gss_init_sec_context(&min_stat, cred_handle, &init_context, target_name, GSS_C_NULL_OID, 0, GSS_C_NO_CHANNEL_BINDINGS, token_ptr, NULL, &send_tok, NULL, NULL); if(init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } Pointer to token to be received Pointer to token to be sent

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage while(1) { accept_maj_stat=gss_accept_sec_context(&min_stat, &accept_context, GSS_C_NO_CREDENTIAL, &send_tok, GSS_C_NO_CHANNEL_BINDINGS, NULL, &mech_type, &recv_tok, &ret_flags, /* ignore time_rec */ NULL, GSS_C_NO_CREDENTIAL); if(accept_maj_stat != GSS_S_COMPLETE && accept_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } else if(accept_maj_stat == GSS_S_COMPLETE) { break; } Context Loop

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage init_maj_stat = gss_init_sec_context(&min_stat, GSS_C_NO_CREDENTIAL, &init_context, target_name, GSS_C_NULL_OID, 0, GSS_C_NO_CHANNEL_BINDINGS, &recv_tok, NULL, &send_tok, NULL, NULL); if(init_maj_stat != GSS_S_COMPLETE && init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } printf("%s:%d: Successfully established initial security context\n", __FILE__, __LINE__); Context established

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage init_maj_stat = gss_init_delegation(&min_stat, init_context, cred_handle, GSS_C_NO_OID, GSS_C_NO_OID_SET, GSS_C_NO_BUFFER_SET, /* &oid_set, */ /* &oid_buffers, */ token_ptr, 0, &send_tok); if(init_maj_stat != GSS_S_COMPLETE && init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } Delegation Example

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage while(1) { accept_maj_stat=gss_accept_delegation(&min_stat, accept_context, GSS_C_NO_OID_SET, GSS_C_NO_BUFFER_SET, &send_tok, 0, &time_rec, &delegated_cred, &mech_type, &recv_tok); if(accept_maj_stat != GSS_S_COMPLETE && accept_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } else if(accept_maj_stat == GSS_S_COMPLETE) { break; } Delegation Loop

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage init_maj_stat = gss_init_delegation(&min_stat, init_context, cred_handle, GSS_C_NO_OID, GSS_C_NO_OID_SET, GSS_C_NO_BUFFER_SET, &recv_tok, 0, &send_tok); if(init_maj_stat != GSS_S_COMPLETE && init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } printf("%s:%d: Successfully delegated credential\n", __FILE__, __LINE__); Credentials delegated

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage /* export and import the delegated credential */ /* this can be done both to a buffer and to a file */ maj_stat = gss_export_cred(&min_stat, delegated_cred, GSS_C_NO_OID, 0, &send_tok); if(maj_stat != GSS_S_COMPLETE) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } To pass delegated credentials from one process to another

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage maj_stat = gss_import_cred(&min_stat, &imported_cred, GSS_C_NO_OID, 0, &send_tok, 0, &time_rec); if(maj_stat != GSS_S_COMPLETE) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } printf("%s:%d: Successfully exported/imported the delegated credential\n", __FILE__, __LINE__); To pass delegated credentials from one process to another

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage /* set up another security context using the delegated credential */ init_maj_stat = gss_init_sec_context(&min_stat, imported_cred, &del_init_context, target_name, GSS_C_NULL_OID, 0, GSS_C_NO_CHANNEL_BINDINGS, token_ptr, NULL, &send_tok, NULL, NULL); if(init_maj_stat != GSS_S_COMPLETE && init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } Establish a second Security context Using delegated credentials

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage while(1) { accept_maj_stat=gss_accept_sec_context(&min_stat, &del_accept_context, imported_cred, &send_tok, GSS_C_NO_CHANNEL_BINDINGS, &target_name, &mech_type, &recv_tok, &ret_flags, /* ignore time_rec */ NULL, GSS_C_NO_CREDENTIAL); if(accept_maj_stat != GSS_S_COMPLETE && accept_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } else if(accept_maj_stat == GSS_S_COMPLETE) { break; } Establish a second Security context Using delegated credentials

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage init_maj_stat = gss_init_sec_context(&min_stat, imported_cred, &del_init_context, target_name, GSS_C_NULL_OID, 0, GSS_C_NO_CHANNEL_BINDINGS, &recv_tok, NULL, &send_tok, NULL, NULL); if(init_maj_stat != GSS_S_COMPLETE && init_maj_stat != GSS_S_CONTINUE_NEEDED) { globus_gss_assist_display_status_str(&error_str, NULL, init_maj_stat, min_stat, 0); printf("\nLINE %d ERROR: %s\n\n", __LINE__, error_str); globus_print_error((globus_result_t) min_stat); exit(1); } /* got sec context based on delegated cred now */ printf("%s:%d: Successfully established security context with delegated credential\n", __FILE__, __LINE__); Establish a second Security context Using delegated credentials

EGEE Usage and Programming Introduction – October 6, An example C GSS-API usage % cat compile_globus_sec #!/bin/sh CC= /opt/gcc-3.2.2/bin/gcc GLOBUS_LOCATION=/opt/globus GLOBUS_FLAVOR=gcc32dbg $CC –I${GLOBUS_LOCATION}/include/${GLOBUS_FLAVOR} ${1}.c \ -L${GLOBUS_LOCATION}/lib \ -lglobus_gssapi_gsi_${GLOBUS_FLAVOR} \ -lglobus_gss_assist_${GLOBUS_FLAVOR} -o ${1} %./compile_globus_sec acquire_credential OR % cat compile_globus_sec #!/bin/sh GLOBUS_LOCATION=/opt/globus GLOBUS_FLAVOR=gcc32dbg CC= /opt/gcc-3.2.2/bin/gcc # $GLOBUS_LOCATION/bin/globus-makefile-header -flavor $GLOBUS_FLAVOR globus_gss_assist > globus_make_header #../globus_make_header $CC ${GLOBUS_INCLUDES} ${1}.c ${GLOBUS_LDFLAGS} \ ${GLOBUS_PKG_LIBS} -o ${1} Compiling and Linking

EGEE Usage and Programming Introduction – October 6, Further Information Grid LCG Security: Globus Security: GGF Security: GSS-API: IETF PKIX charter: PKCS: