METU Department of Computer Engineering



Similar documents
NetSec Exercise 8 Communication Mixes

[SMO-SFO-ICO-PE-046-GU-

Security OpenSSL SSL. Roberta Daidone.

StreamServe Persuasion SP4 Service Broker

Configuring SSL Termination

Lab 5: BitTorrent Client Implementation

Iowa Immunization Registry Information System (IRIS) Web Services Data Exchange Setup. Version 1.1 Last Updated: April 14, 2014

Secure Voic Transcription: Speech to Text with Cisco Unity Connection Voice Messages

µtasker Document FTP Client

Crypto Lab Public-Key Cryptography and PKI

Packet Sniffing and Spoofing Lab

Lukasz Pater CMMS Administrator and Developer

Network Security - Secure upper layer protocols - Background. Security. Question from last lecture: What s a birthday attack? Dr.

A PKI case study: Implementing the Server-based Certificate Validation Protocol

OpenSSL: Secure Communication

SBClient SSL. Ehab AbuShmais

ZVA64EE PERFORMANCE BENCHMARK SOFINTEL IT ENGINEERING, S.L.

SSL Tunnels. Introduction

CS 241 Data Organization Coding Standards

Configuring Security Features of Session Recording

Programming OpenSSL. The Server Perspective. by Sean Walton. Copyright 2001 Sean Walton

SMTP-32 Library. Simple Mail Transfer Protocol Dynamic Link Library for Microsoft Windows. Version 5.2

Job Reference Guide. SLAMD Distributed Load Generation Engine. Version 1.8.2

Security Policy Revision Date: 23 April 2009

What Your Mother Didn't Tell You About PEM, DER, PKCS. Eric Norman University of Wisconsin-Madison

Secure XML API Integration Guide. (with FraudGuard add in)

FileMaker Server 7. Administrator s Guide. For Windows and Mac OS

Lab 4: Socket Programming: netcat part

KMIP installation Guide. DataSecure and KeySecure Version SafeNet, Inc

HTTP Reverse Proxy Scenarios

Ciphermail for BlackBerry Reference Guide

esync - Receiving data over HTTPS

Ciphermail Gateway Separate Front-end and Back-end Configuration Guide

How To Understand And Understand The Ssl Protocol ( And Its Security Features (Protocol)

Clearswift Information Governance

Chapter 2: Remote Procedure Call (RPC)

Angels (OpenSSL) and D(a)emons. Athula Balachandran Wolfgang Richter

TUTORIAL FOR INITIALIZING BLUETOOTH COMMUNICATION BETWEEN ANDROID AND ARDUINO

McAfee Cloud Identity Manager

Implementing Secure Sockets Layer on iseries

Architecting the Future of Big Data

WHITE PAPER Citrix Secure Gateway Startup Guide

The POSIX Socket API

ENABLING RPC OVER HTTPS CONNECTIONS TO M-FILES SERVER

Accessing PostgreSQL through JDBC via a Java SSL tunnel

The release notes provide details of enhancements and features in Cloudera ODBC Driver for Impala , as well as the version history.

avast! for linux technical documentation

infilename outfilename signcert privkey headers flags

Socket Programming. Srinidhi Varadarajan

Skywire TCP Socket Examples

Setting Up SSL on IIS6 for MEGA Advisor

CA Nimsoft Unified Management Portal

3.5. cmsg Developer s Guide. Data Acquisition Group JEFFERSON LAB. Version

1. The Web: HTTP; file transfer: FTP; remote login: Telnet; Network News: NNTP; SMTP.

How To Understand And Understand The Security Of A Key Infrastructure

Design Notes for an Efficient Password-Authenticated Key Exchange Implementation Using Human-Memorable Passwords

Generalised Socket Addresses for Unix Squeak

SSL/TLS Programming. sslclient.c. /* A simple SSL client. It connects and then forwards data from/to the terminal to/from the server */

/ Preparing to Manage a VMware Environment Page 1

Introducing the BIG-IP and SharePoint Portal Server 2003 configuration

IUCLID 5 Guidance and Support

Terminal Server Configuration and Reference Errata

LBA API Manual Ver.1.0.1

VIRTUAL LABORATORY: MULTI-STYLE CODE EDITOR

Windows Based FTP Server with Encryption and. other Advanced Features.

Managing the SSL Certificate for the ESRS HTTPS Listener Service Technical Notes P/N REV A01 January 14, 2011

Lab Exercise SSL/TLS. Objective. Step 1: Open a Trace. Step 2: Inspect the Trace

E-Commerce: Designing And Creating An Online Store

openssl egg Bindings to the OpenSSL SSL/TLS library Extension for Chicken Scheme Version Thomas Chust

INTEGRATE SALESFORCE.COM SINGLE SIGN-ON WITH THIRD-PARTY SINGLE SIGN-ON USING SENTRY A GUIDE TO SUCCESSFUL USE CASE

Generate CSR for Third Party Certificates and Download Unchained Certificates to the WLC

CONTRACT MODEL IPONZ DESIGN SERVICE VERSION 2. Author: Foster Moore Date: 20 September 2011 Document Version: 1.7

Copyright 2013 EMC Corporation. All Rights Reserved.

Apache, SSL and Digital Signatures Using FreeBSD

Configuring Secure Socket Layer (SSL)

Pre-configured AS2 Host Quick-Start Guide

2014 IBM Corporation

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7/v1.8

SSL (Secure Socket Layer)

Document Security. ados.com ADOS Corporation ADOS Corporation

Introduction to Programming II Winter, 2014 Assignment 2

Deploying the BIG-IP LTM system and Microsoft Windows Server 2003 Terminal Services

1 Introduction: Network Applications

Computer Systems II. Unix system calls. fork( ) wait( ) exit( ) How To Create New Processes? Creating and Executing Processes

WINGS WEB SERVICE MODULE

Using etoken for Securing s Using Outlook and Outlook Express

Configuring Nex-Gen Web Load Balancer

CPSC Network Programming. , FTP, and NAT.

SQL. Short introduction

Configure SecureZIP for Windows for Entrust Entelligence Security Provider 7.x for Windows

Overview. SSL Cryptography Overview CHAPTER 1

Using LDAP Authentication in a PowerCenter Domain

Configure Managed File Transfer Endpoints

Developing a Web Server Platform with SAPI Support for AJAX RPC using JSON

Transcription:

METU Department of Computer Engineering CEng 332 - System Programming and Support Environments Spring 2007-2008 Final (Take Home / Due: Jun 16, 10:00 AM/5 pages) Name: No: Signature: Note: You are not expected to give complete codes in any of the questions. Just provide significant parts of the code. Replace details with simple verbal description, use pseudo-code whenever appropriate. Your code is not expected to work, just describe key parts of programs. Question 1 : (30 points) Assume you have a directory of plugins and each plugin is a shared object file. Your task is to check directory periodically, load plugins added to directory and start their entry functions in threads. Each plugin implements getinfo() and startservice() functions: # define PLUGINPATH "/ var / run / final332 / plugin /" struct p l i n f o { char name [40]; // name of the plugin char d e s c [40]; // description int p o r t ; // TCP / IP port that plugin is attacched to char p a t h [MAX PATH]; // path of the plugin ( set by the main thread ) p t h r e a d t t i d ; // thread running the plugin ( set by the main thread ) } ; void g e t i n f o ( struct p l i n f o *); void s t a r t s e r v i c e ( void *); Assume plugins will never be deleted explicitly from the directory. a)give code of the main thread of the program that: Checks PLUGINPATH directory for new plugins once in 10 seconds Load shared object with dl library Call getinfo() of the plugin to get plinfo structure from plugin and insert into a data structure (use pseudo code for insertion etc.). Create a new thread with startservice() of the plugin, set tid field of the plinfo. b)give code of a function unloadplugin(char *name) that: finds the name from the plugin information. destroys the thread plugin is running on deletes the shared object file from plugin directory make sure that main thread do not reload it before you delete it This function is to be called explicitly on demand. c)give code of a sample plugin named ECHO. It: listens on tcp port 56789 creates a new thread on each connection for each connection reads a line with at most 1024 bytes, and write the same line back at the same socket Plugin should implement getinfo() and startservice() functions. 1

Question 2 : (25+10 points) Assume you want to define an TCP/IP based service for the following functions described in pseudo code: int c r e a t e t a b l e ( s t r i n g t a b l e n a m e ); int d e l e t e t a b l e ( s t r i n g t a b l e n a m e ); struct p a i r { s t r i n g key ; s t r i n g v a l u e ; }; int s e t v a l u e ( s t r i n g tablename, struct p a i r k e y a n d v a l u e ); s t r i n g g e t v a l u e ( s t r i n g tablename, s t r i n g key ); l i s t o f s t r u c t p a i r g e t a l l v a l u e s ( s t r i n g t a b l e n a m e ); You can think of a scenario where programs access to tables of key-value pairs of strings. Keys per table is unique and if it exists in a table, a string value can be retrieved or set. a)give XDR definition (to be used for rpcgen utility) of this service description for SUN/RPC (also known as ONC/RPC). You can use any program number. Give a linked list of struct pair records for the last function. Only provide the.x file. b)assume your service is an XML/RPC service. Provide the XML structures of the call and return messages for 5 functions. You can use arbitrary sample values for parameters and return values. Assume last function returns an array with 2 struct pair. Assume no error occured. c)(+10 points bonus) Assume your service is a Corba service. Provide IDL for the service. 2

Question 3 : (25 points) You are given the following SSL certificate file: -----BEGIN CERTIFICATE----- MIIExzCCA6+gAwIBAgIJAOoOAMg1mMTcMA0GCSqGSIb3DQEBBQUAMIGdMQswCQYD VQQGEwJUWjESMBAGA1UECBMJS29yYmF0dXJhMQ4wDAYDVQQHEwVCYWJpbDEbMBkG A1UEChMSQ0VuZyAzMzIgU29sdXRpb25zMQ4wDAYDVQQLEwVGaW5hbDEcMBoGA1UE AxMTU3lzdGVtcyBQcm9ncmFtbWluZzEfMB0GCSqGSIb3DQEJARYQb251ckBtZXR1 LmVkdS50cjAeFw0wODA2MTExMzU0MjlaFw0wODA3MTExMzU0MjlaMIGdMQswCQYD VQQGEwJUWjESMBAGA1UECBMJS29yYmF0dXJhMQ4wDAYDVQQHEwVCYWJpbDEbMBkG A1UEChMSQ0VuZyAzMzIgU29sdXRpb25zMQ4wDAYDVQQLEwVGaW5hbDEcMBoGA1UE AxMTU3lzdGVtcyBQcm9ncmFtbWluZzEfMB0GCSqGSIb3DQEJARYQb251ckBtZXR1 LmVkdS50cjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALaBdRKWdpM0 WVFw1w9H6afe+oY/GVmBgfhUBxtIE/qMJ//2Ak32tMr48t7y/OowGryCUkGrsiVU FB66nK+fSm1ElO0c0fkbYUlqDcz8YxcwJnU7jkVAHrwDlmonKeIAHwSrex2baitd VeM572PxIhoJwmd42WU6qa/fjjB5/uISnC+MUVvwlNbNJBiTYrkQRy36uJr7x1jM hjvnky1cxp4w09dttz8mlkd6emvvraqqrxngdwjdnuntu7pkssd9dejotaahpxl/ Olieo92u7yrEQ5j8g2POqXgUM3MjRRvbQ/w5MjOWFuf80Uft3w0t6BS1jfeo2rzO JuUdYne9loUCAwEAAaOCAQYwggECMB0GA1UdDgQWBBR6oRTVX0X8moaofJo69Glu A9pHzjCB0gYDVR0jBIHKMIHHgBR6oRTVX0X8moaofJo69GluA9pHzqGBo6SBoDCB ntelmakga1uebhmcvfoxejaqbgnvbagtcutvcmjhdhvyyteomawga1uebxmfqmfi awwxgzazbgnvbaoteknfbmcgmzmyifnvbhv0aw9uczeomawga1uecxmfrmluywwx HDAaBgNVBAMTE1N5c3RlbXMgUHJvZ3JhbW1pbmcxHzAdBgkqhkiG9w0BCQEWEG9u dxjabwv0ds5lzhuudhkccqdqdgdinzje3dambgnvhrmebtadaqh/ma0gcsqgsib3 DQEBBQUAA4IBAQCp+TDWI4ks0aG4bBvv+Ikl0UaMpnM43nd7qcRz3HT5XQe+o2Rr 1LhURHwPxqnvo+r0qmD4KqRX9xhjIWsHsLAcKtD/MgyzIDm8+rOMU0kNWcGibheW qwnblf8cy2zfwx8tx451+cq5n16ht11tn1zq8ihi5qgg5y6paaaq3e6sdt9hjsva b4hbsnylr5zdd/wnbfwt10tct0wufskxhwukuvyejmqyciu3/mb8tepqvx45u6jl vcekh2mmfq9sacoav5amfowk+5sazxc3shw4ftwllan8t58qvicsog4tuglambem PE1qSvvuTq2nM3QZygiVLur1WHI1q5hzZQTy -----END CERTIFICATE----- and the following private key file: -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEAtoF1EpZ2kzRZUXDXD0fpp976hj8ZWYGB+FQHG0gT+own//YC Tfa0yvjy3vL86jAavIJSQauyJVQUHrqcr59KbUSU7RzR+RthSWoNzPxjFzAmdTuO RUAevAOWaicp4gAfBKt7HZtqK11V4znvY/EiGgnCZ3jZZTqpr9+OMHn+4hKcL4xR W/CU1s0kGJNiuRBHLfq4mvvHWMyGO+crLUJenhbT11O3PyYsoPoQxVWsCqqtc0Z3 AkM1Se27s+RJJ30N6M5NoAc/Ev86WJ6j3a7vKsRDmPyDY86peBQzcyNFG9tD/Dky M5YW5/zRR+3fDS3oFLWN96javM4m5R1id72WhQIDAQABAoIBAB5Xx68fdPdkbLUt nzpc0owofl7bfstyzlkmv2g5yhin1nipfhiyo9bdlr4ekcihduqageykz0ofhxlu 09gfE7C3BkulzwMrmjEqgMDj9VWVm89B55V746A+uHNNr5jzjDSqjf2OKUisa+sr ZrGnFZReqwOpA/vglPW4pVtJ7SaIya7d6L62YnysMSVlpLbDlLylQw3i9izwQdsv axnivpqxeu45muegavmw6bakz1namr6c7yh4vartxbqr7lzedtwigkpb8blr6s1u FQmCbBEhMq366C1z+5ZCOZP49T2F/4l9pAlvdWuvKYPzDPmTeuuZzIOdWfxMRVfX nkuqqaecgyea2oo/hka9iqt0nw3+nbcvisgaeiqvfcnaufjei7sofzicho9hyuo4 9/nFb/ks7dz6DMFr0ehJzBlxJcGstbsZ5XBLqL3aRdL9EfwAXpoAqfIqH0ltIhCt VFWhQn8fAfq0Ic+pPt/TVtYeCDi+pErU2pYVeywg1Xawon+K3OJAfYUCgYEA12py zomdbtxndntmfqmjsl07qn3stxl6ihh+xtfu1bbdcp6jd2wh1nw6kzj3gzr1uwwi sbxrlz3kqqunc6a9szg2atxbvz6zxkzevohoabkw22bsdo49ugihzvmyiiwigorx zxklfgo2ckvbolzozbtfqzlnbw5vhux1dn5bhqecgyeal7gqgtv+ovodnd8dxg6z LEvU9w7YsQTV4WnKl/kV18o+Z8qcZQXlv+J82dUQPIlahkNd8uEhhFOjFIJCFpT3 Bsck0699k2p/P+3eIExb/ID4Pwuu/a1mXV7Ku+SHPm4nQKKqP+RyPwDg3mU5yVTh TMS933k8ubAa2HyWFelUq7UCgYBd9CeuCBaJk4EoC9ObpZVRHijCj3m2ijdet6BT FFouVuqBvz88zvl8KEz/Q+BwcWjZ36JdfYfO8dbSOZCwaIEXUs9kg/XFG+B4pd1F 2hMrlAXMG8/2xYMolBkjxOkqYl7GK6eEwXUOt47TAsDk/57OlvaDSkHjtjSZWseT UrlIAQKBgQCfmL2pTsb5NA17goLD3G54ehQMIvIX2CaSXeEjUDX7hBJqQui/q/FC u9dh9pbrgzkueo3lwhtedeueust6sqhzcor9h3opw+yktieo/xab0fmck4q0fedg 54SDsxchKiypiQqRNChZZINwT2FS0VS+J/BuKzTOGgzGf94HYTdk+A== -----END RSA PRIVATE KEY----- a)what is the issuer, validity information of this self signed certificate and how many of bits used in RSA? Use openssl command. Only give the required information. b)assume you use this files are available on your filesystem and you use them to have an SSL connection. Give the required calls to set your private key, set your certificate, get peers certificate and verify peers certificate in openssl library. Only provide the calls, no error handling. Assume connection is established and ssl and ssl ctx variables are ready and set. 3

c)somebody used this certificate and sent you an encrypted mail. Use your private key to decrypt the following message: MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; smime-type=enveloped-data; name="smime.p7m" Content-Transfer-Encoding: base64 MIICLQYJKoZIhvcNAQcDoIICHjCCAhoCAQAxggHIMIIBxAIBADCBqzCBnTELMAkG A1UEBhMCVFoxEjAQBgNVBAgTCUtvcmJhdHVyYTEOMAwGA1UEBxMFQmFiaWwxGzAZ BgNVBAoTEkNFbmcgMzMyIFNvbHV0aW9uczEOMAwGA1UECxMFRmluYWwxHDAaBgNV BAMTE1N5c3RlbXMgUHJvZ3JhbW1pbmcxHzAdBgkqhkiG9w0BCQEWEG9udXJAbWV0 ds5lzhuudhiccqdqdgdinzje3danbgkqhkig9w0baqefaascaqcmj6d4joqb0vkq ianxr9vbsrgjwdtmm0xlrr2gtsa538wzpvuttehs3i/v/1j8z0o6lsw9zb8hnyzh qrqidom4prneiaw9ufyz1qxdvez4cwgekgz4d9a6bv0uxdpe7xfcvfext5hnmu+e 7rsft4fL59JPikr6NVdXHrD7X3MFNd777uTo+TXy1MDNbiKCHIZT1YlSNbrYMyly 4V4MimZrNmR4tLznW3k3EDIaJAKg4rHAR0mBOktQVex+zP6hgZbDSaMlcNhmYPjV ZDkwDaHGLwi+Q+tX6lOJg7YZoXcrE/PCyawpYkqK6s3bwQD7VKwRiLdG6f31/5rG Rn9Gl5lYMEkGCSqGSIb3DQEHATAaBggqhkiG9w0DAjAOAgIAoAQIwQODqEjC1+CA IHk24TMKBt1ha79DHbXtuNIPQC30qbLMwuMYYohkKM8x Use smime subcommand of the openssl utility. provide the command line you used and the resulting decrypted text. 4

Question 4 : (25 pts) Assume I need the following information (tags) in a course report XML file: course name code root element Name of the course 7 digit integer code of the course instructors assistants List of staff information, that are instructors of the course. 1 or more instructors. List of staff information, that are teaching assistants of the course. 0 or more assistants. staff Staff information, The name and pid of the staff. students List of 1 or more student tags consisting of name, studentid and grades tags. name Any string studentid A string of the form dddddd-d grades Grades of a a student including midterm, final tags containing a single integer in range 0-120, homeworks tag containing list of 2 homework tags, overall tag containing a real value in range 0-120, letter tag containing one of the strings AA, BA, BB,..., FF, I, NA A sample course.xml file will look like: < course > <name > Systems Programming </ name > <code > 5710332 </ code > < intructors > <staff ><name >Onur S e h i t o g l u </ name > <pid > 117951 </ pid > </ staff > </ instructors > < assistants > <staff ><name > Cuneyt Mertayak </ name > <pid > 187120 </ pid > </ staff > </ assistants > < students > < student ><name > F a h r e t t i n C u r e k l i b a t u r </ name > < studentid >123423-2 </ studentid > < grades >< midterm >100 </ midterm ><final >88 </ final > < homeworks >< homework >86 </ homework > < homework >91 </ homework ></ homeworks > < overall > 82.2123 </ overall > < letter >AA</ letter > </ grades > </ student > < student ><name >Fatma G i r i k </ name > < studentid >123498-2 </ studentid > < grades >< midterm >95 </ midterm ><final >98 </ final > < homeworks >< homework >96 </ homework > < homework >51 </ homework ></ homeworks > < overall > 88.2123 </ overall > < letter >AA</ letter > </ grades > </ student > </ students > </ course > a)give DTD for this document type. b)give XSD for this document type. Put all restrictions given in the descriptions. 5