SlideShare a Scribd company logo
1 of 17
Download to read offline
OpenSSL 
Basic Function Call Flow 
William.L 
wiliwe@gamil.com 
2006-06-13
Index 
Summary.......................................................................................................................................................... 3 
OpenSSL Data Structures .............................................................................................................................. 4 
genRANDOM() Function ............................................................................................................................. 10 
Reference ....................................................................................................................................................... 17
Summary 
Purpose 
This document provides a basic function calling flow of OpenSSL library for constructing a secure TCP 
connection to send/receive critical data. 
General Description 
The OpenSSL library implements the Secure Sockets Layer (SSL v2/v3) protocols. 
At first, the library must be initialized by calling the function : SSL_library_init() . 
Then an SSL_CTX object is created as a framework to establish TLS/SSL enabled connections. This object 
is created by calling the function : SSL_CTX_new(). 
Various options regarding certificates, algorithms etc. can be set in this object. 
When a network connection (e.g. TCP connection) has been created, it can be assigned to an SSL object. 
After the SSL object has been created using SSL_new(), SSL_set_fd() or SSL_set_bio() can be used to 
associate the network connection with the object. 
Then the TLS/SSL handshake is performed using SSL_accept() (for server side) or SSL_connect() (for 
client side) respectively. 
SSL_read() and SSL_write() are used to read and write data on the TLS/SSL connection. 
SSL_shutdown() can be used to shut down the TLS/SSL connection.
OpenSSL Data Structures 
Currently the OpenSSL library functions deals with the following data structures: 
SSL_METHOD 
The SSL Method. That's a dispatch structure describing the internal SSL library methods/functions which 
implement the various protocol versions (SSLv1, SSLv2 and TLSv1). It's needed to create an SSL_CTX. 
Data Structure SSL_METHOD 
Definded in ssl.h 
File Location OpenSSL-Srcssl 
SSL_CIPHER 
The SSL Cipher. This structure holds the algorithm information for a particular cipher which are a core part 
of the SSL/TLS protocol. The available ciphers are configured on a SSL_CTX basis and the actually used 
ones are then part of the SSL_SESSION. 
Data Structure SSL_CIPHER 
Definded in ssl.h 
File Location OpenSSL-Srcssl 
SSL_CTX 
The SSL Context. That's the global context structure which is created by a server or client once per program 
life-time and which holds mainly default values for the SSL structures which are later created for the 
connections. 
Data Structure SSL_CTX 
Definded in ssl.h 
File Location OpenSSL-Src ssl 
SSL_SESSION 
The SSL Session . This is a structure containing the current TLS/SSL session details for a connection: 
SSL_CIPHER, client and server certificates, keys, etc. 
Data Structure SSL_SESSION 
Definded in ssl.h 
File Location OpenSSL-Src ssl 
SSL 
The SSL Connection . That's the main SSL/TLS structure which is created by a server or client per 
established connection. This actually is the core structure in the SSL API. Under run-time the application 
usually deals with this structure which has links to mostly all other structures.
Data Structure SSL 
Definded in ssl.h 
File Location OpenSSL-Src ssl
Basic Calling Flow 
int SSL_library_init(void) 
Initializing the OpenSSL library. 
call 
SSL_METHOD *SSLv23_method(void) 
Constructor for the SSLv2 or SSLv3 
SSL_METHOD structure for combined 
client and server. 
call 
SSL_CTX* SSL_CTX_new(SSL_METHOD *method) 
SSL_CTX object is created as a framework to establish 
TLS/SSL enabled connections. 
call 
RAND_add() : Load the Randomness 
This step is for initializing the randomness for generating session key 
(client key). 
This phase will do automatically with RAND_poll() function which will 
call RAND_add() indirectly in below O.S platform: 
<1>OS2 <2>Unix <3>OpenBSD <4>Linux <5>Windows. 
If the platform other than the above, we must call RAND_add() explicitly. 
For example, in VxWorks RTOS, it must call RAND_add() explicitly. 
call
call 
Creates a TCP connection. 
{ This will generate a socket 
handler,e.g. file descriptor } 
call 
SSL* SSL_new(SSL_CTX *ctx) 
Creates a new SSL structure which 
is needed to hold the data for a 
TLS/SSL connection. 
call 
int SSL_set_fd (SSL *ssl, int fd) 
Sets the file descriptor fd as the input/output facility for 
the TLS/SSL (encrypted) side of ssl. fd will typically be 
the socket file descriptor of a network connection. 
call 
call 
Is this a Server 
application 
Yes, this is a 
Server application 
call 
No, this is a Client 
application 
int SSL_connect(SSL *ssl) 
Initiates the TLS/SSL handshake 
with a server. 
SSL Handshaking 
int SSL_accept(SSL *ssl) 
Waits for a TLS/SSL client to 
initiate the TLS/SSL handshake. 
Successful Handshaking
int SSL_read(SSL*ssl, void *buf, int num) 
Tries to read num bytes from the specified 
ssl into the buffer buf. 
int SSL_write(SSL *ssl, const void 
*buf, int num) 
Writes num bytes from the buffer buf into 
the specified SSL connection, ssl. 
from read from write 
Need to 
terminating the 
SSL connection? 
No, continues to 
use the active 
SSL connection. 
Yes, terminate the 
SSL connection 
int SSL_shutdown(SSL *ssl) 
Shuts down an active TLS/SSL 
connection. It sends the “close notify” 
shutdown alert to the peer. 
Going back to the 
SSL read/write 
operation 
call 
int SSL_free(SSL *ssl) 
Decrements the reference count of ssl, and removes the 
SSL structure pointed to by ssl and frees up the allocated 
memory if the the reference count has reached 0. 
call 
read 
operation? 
call 
No, this is a 
write operation 
call 
Yes, this is a 
read operation 
Successful Handshaking
call 
int SSL_CTX_free(SSL_CTX *ctx) 
Decrements the reference count of ctx, and removes the SSL_CTX 
object pointed to by ctx and frees up the allocated memory if the the 
reference count has reached 0. 
It also calls free() to release memory of items(if it is available): 
session cache, list of ciphers, list of Client CAs, certificates and keys. 
call 
int close(int socket) 
This the socket function to close a 
socket and terminate a TCP connection. 
Finish 
The above function call flow is just a basic flow to create a SSL connection without client authentication 
and doing read/write operations.
genRANDOM() Function 
This is a randomness initialization function we created. It calls the OpenSSL function, RAND_add(), to 
accomplish the randomness initialization operation(that is to seed unpredictable data to a cryptographic 
PRNG (Pseudo-Random Number Generator). The function signature is : 
void RAND_add (const void *buf, int num, double entropy) 
The followings are the steps showing how to use RAND_add() function to initailize randomness. 
Step 1) 
We created a string type variable and fill arbitrary chars (the content should be unpredictable that any one 
can’t guess it). In our codes, we do as below : 
static char* strRANDOM = 
"FreeBSD -STABLE #4: Tue g5 15:50:0PDT000 
Tiecounti8254 frequen193182 Hz 
CP: Pent II/Xeon/Celeron400.MHz 6-cls CPU) 
Prbing fdevices on PCI b: 
chp0: <Il 82443BX host tI bri> v 02 on pci0.0.0 
Prbing fPnP devices: 
sc: VGA or <16 virtualoles, flagsx0> 
ed not fd at 0x280 
ah0 not nd at 0x34 
ai0 not nd 
vg0 at 00-0x3df madd000 msize 1372 on isa"; 
Step 2) 
Now, we start use RAND_add() function to seed PRNG. The using is shown below :
for(;;) 
{ 
if (Bytes > 0) 
n = (Bytes < BUFSIZ)?(int)Bytes:BUFSIZ; 
else 
n = BUFSIZ; 
while( (i = rand()%1000-13) ==0) 
; 
strncpy(buf, (strRANDOM+offset), i); 
RAND_add (buf, n, i); 
offset += i; 
if (offset>=(len+1)) 
break; 
if (Bytes > 0) 
{ 
Bytes -= n; 
if (Bytes <= 0) 
break; 
} /*if(Bytes)*/ 
} /* for(;;) */
The complete genRANDOM() body is : 
#define BUFSIZ 1024 
static void genRANDOM() 
{ 
long Bytes = 1024*10; 
int i =0, offset=0, n=0, len=strlen(strRANDOM); 
char buf[BUFSIZ]; 
printf("[CWMP] genRANDOM()n"); 
memset(buf, 0, BUFSIZ); 
for(;;) 
{ 
if (Bytes > 0) 
n = (Bytes < BUFSIZ)?(int)Bytes:BUFSIZ; 
else 
n = BUFSIZ; 
while( (i = rand()%1000-13) ==0) 
; 
strncpy(buf, (strRANDOM+offset), i); 
RAND_add (buf, n, i); 
offset += i; 
if (offset>=(len+1)) 
break; 
if (Bytes > 0) 
{ 
Bytes -= n; 
if (Bytes <= 0) 
break; 
} 
} /* End of for(;;) */ 
} /* End of genRAND() */
SSL Client Side Example Codes 
#include "openssl/bio.h" 
#include "openssl/crypto.h" 
#include "openssl/x509.h" 
#include "openssl/ssl.h" 
#include "openssl/err.h" /* For error message */ 
#include “openssl/rand.h” /* For RAND_add() */ 
#define BUFSIZZ 2048 
/*================ Global variables ================*/ 
static char *hostIP = "10.1.25.162"; 
struct sockaddr_in addr; /* socket address */ 
int sock = 0; /* socket */ 
unsigned int hp = 0; /* for host IP address */ 
int ret= 0, request_len, len; 
char buf[BUFSIZZ]; 
SSL_METHOD *meth = NULL; 
SSL_CTX *ctx = NULL; 
BIO *sbio = NULL; 
/*===================== SSL Initialization =====================*/ 
SSL_library_init(); /* Initializing the SSL libraries */ 
SSL_load_error_strings(); /* Loading the error message string for each error code */ 
meth = SSLv23_method(); /* Init the methods for handshaking and accessing SSL data */ 
ctx = SSL_CTX_new(meth); /* Create a SSL context */ 
genRANDOM(); 
printf("SSL Init Done!n"); 
/* Resolving the IP address of the target host */ 
if ( (hp=hostGetByName((char*)hostIP)) == ERROR) /* hostGetByName() calls gethostbyname()*/ 
{ 
/* socket interface */ 
printf ("Couldn't resolve host"); 
exit (1); 
} 
/* Setting the network address structure */ 
memset (&addr, 0, sizeof(addr)); 
addr.sin_addr.s_addr = INADDR_ANY; 
addr.sin_family = AF_INET; 
addr.sin_port = htons (443); /* Well-known port number for HTTPS */
/* Get the socket */ 
if ( (sock = socket(AF_INET,SOCK_STREAM, IPPROTO_TCP))<0 ) 
{ 
fprintf(stderr, "Couldn't create socket"); 
exit(1); 
} 
/*================ Try to create the TCP connection ================*/ 
if ( connect(sock, (struct sockaddr *)&addr, sizeof(addr))<0 ) 
{ 
fprintf(stderr, "Couldn't connect socket"); 
exit(1); 
} 
printf("The TCP Connection is created!n"); 
/*================ Create the SSL connection context ================*/ 
ssl = SSL_new (ctx); 
sbio = BIO_new_socket (sock, BIO_NOCLOSE); 
SSL_set_bio (ssl, sbio, sbio); 
printf("Starting to do SSL Handshaking…n"); 
if ( SSL_connect (ssl) <= 0 ) /* Note: at this point it is in blocking mode */ 
{ 
char errstr[256]; 
int sslres; 
printf("SSL handshaking fail!n"); 
sslres = SSL_get_error (ssl, res); 
ERR_error_string_n (sslres, errstr,s 256); /* Convert the error code to the man readable error 
string. */ 
printf(“The SSL error is %d => %sn”, sslres, errstr); 
exit(1); 
} 
char* httpRequest = 
”GET /top.html HTTP/1.0rnUser-Agent:" 
"HTTP_ClientrnHost: 10.1.25.162:443rnrn”; 
request_len = strlen (httpRequest ); 
ret = SSL_write(ssl, httpRequest , request_len); /* Send out the HTTP request message */ 
switch ( SSL_get_error(ssl, ret) )
{ 
case SSL_ERROR_NONE : 
if ( request_len != ret ) 
{ 
fprintf(stderr, "Incomplete write!"); 
exit(1); 
} 
break; 
default: 
fprintf(stderr, "SSL write problem"); 
exit(1); 
} /* End of switch */ 
/* Now read the server's response, assuming that it's terminated by a close */ 
while (1) 
{ 
ret = SSL_read (ssl, buf, BUFSIZZ); 
switch ( SSL_get_error (ssl, ret)) 
{ 
case SSL_ERROR_NONE: 
len=ret; 
break; 
case SSL_ERROR_WANT_READ: 
continue; 
case SSL_ERROR_ZERO_RETURN: 
goto shutdown; 
case SSL_ERROR_SYSCALL: 
fprintf(stderr,"SSL Error: Premature closen"); 
goto done; 
default: 
{ 
fprintf(stedrr, "SSL read problem"); exit(1); 
} 
} /* End of switch */ 
printf("Content = n%sn", buf); 
} /* End of while(1) */ 
shutdown: 
ret = SSL_shutdown (ssl); /* Send “Close” notify to the HTTP server */ 
switch(ret) 
{ 
case 1: 
break; /* Success */
case 0: 
case -1: 
default: 
{ fprintf(stderr, "Shutdown failed"); exit(1); } 
} /* End of switch */ 
done: 
SSL_free(ssl); 
SSL_CTX_free (ctx); 
close(sock); /* Send “Close” notify to the HTTP server */ 
/*~~~~~~~~~~~~~~~~~~~ End of SSL client side example codes ~~~~~~~~~~~~~~~~~~~*/
Reference 
* OpenSSL, http://www.openssl.org/ 
* http://www.openssl.org/docs/apps/ 
* http://www.openssl.org/docs/crypto/ 
* http://www.openssl.org/docs/ssl/ 
* PRNG implementation interface of OpenSSL 
http://www.openssl.org/docs/crypto/rand.html 
* RAND_add function how-to 
http://www.openssl.org/docs/crypto/RAND_add.html 
* Randomness Recommendations for Security 
http://www.potaroo.net/ietf/rfc/rfc1750.txt

More Related Content

What's hot

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking ExplainedThomas Graf
 
1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례I Goo Lee
 
Locking in Linux Traffic Control subsystem
Locking in Linux Traffic Control subsystemLocking in Linux Traffic Control subsystem
Locking in Linux Traffic Control subsystemCong Wang
 
containerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdcontainerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdDocker, Inc.
 
Routing and switching essentials companion guide
Routing and switching essentials companion guideRouting and switching essentials companion guide
Routing and switching essentials companion guideSiddhartha Rajbhatt
 
OpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-ServiceOpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-ServiceRamon Acedo Rodriguez
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture ForumChristopher Spring
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionOlle E Johansson
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례I Goo Lee
 
Understanding DPDK algorithmics
Understanding DPDK algorithmicsUnderstanding DPDK algorithmics
Understanding DPDK algorithmicsDenys Haryachyy
 
VXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksAPNIC
 
Exploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBExploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBIgor Donchovski
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge MigrationJames Denton
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesPaolo Visintin
 
Implementing and Troubleshooting PVS
Implementing and Troubleshooting PVSImplementing and Troubleshooting PVS
Implementing and Troubleshooting PVSDavid McGeough
 

What's hot (20)

Linux Networking Explained
Linux Networking ExplainedLinux Networking Explained
Linux Networking Explained
 
OpenSIPS Workshop
OpenSIPS WorkshopOpenSIPS Workshop
OpenSIPS Workshop
 
Redis database
Redis databaseRedis database
Redis database
 
1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례1.mysql disk io 모니터링 및 분석사례
1.mysql disk io 모니터링 및 분석사례
 
Locking in Linux Traffic Control subsystem
Locking in Linux Traffic Control subsystemLocking in Linux Traffic Control subsystem
Locking in Linux Traffic Control subsystem
 
containerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerdcontainerd summit - Deep Dive into containerd
containerd summit - Deep Dive into containerd
 
Routing and switching essentials companion guide
Routing and switching essentials companion guideRouting and switching essentials companion guide
Routing and switching essentials companion guide
 
OpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-ServiceOpenStack Ironic - Bare Metal-as-a-Service
OpenStack Ironic - Bare Metal-as-a-Service
 
Redis overview for Software Architecture Forum
Redis overview for Software Architecture ForumRedis overview for Software Architecture Forum
Redis overview for Software Architecture Forum
 
Linux Network Stack
Linux Network StackLinux Network Stack
Linux Network Stack
 
Kamailio :: A Quick Introduction
Kamailio :: A Quick IntroductionKamailio :: A Quick Introduction
Kamailio :: A Quick Introduction
 
Federated Engine 실무적용사례
Federated Engine 실무적용사례Federated Engine 실무적용사례
Federated Engine 실무적용사례
 
Understanding DPDK algorithmics
Understanding DPDK algorithmicsUnderstanding DPDK algorithmics
Understanding DPDK algorithmics
 
CloudStack Networking
CloudStack NetworkingCloudStack Networking
CloudStack Networking
 
VXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building BlocksVXLAN BGP EVPN: Technology Building Blocks
VXLAN BGP EVPN: Technology Building Blocks
 
Exploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDBExploring the replication and sharding in MongoDB
Exploring the replication and sharding in MongoDB
 
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
2014 OpenStack Summit - Neutron OVS to LinuxBridge Migration
 
Kamailio with Docker and Kubernetes
Kamailio with Docker and KubernetesKamailio with Docker and Kubernetes
Kamailio with Docker and Kubernetes
 
Implementing and Troubleshooting PVS
Implementing and Troubleshooting PVSImplementing and Troubleshooting PVS
Implementing and Troubleshooting PVS
 
Ccna day3
Ccna day3Ccna day3
Ccna day3
 

Viewers also liked

Crypto With OpenSSL
Crypto With OpenSSLCrypto With OpenSSL
Crypto With OpenSSLZhi Guan
 
OpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatOpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatVittorio Giovara
 
OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)Shteryana Shopova
 
Pasivni elektronski elementi
Pasivni elektronski elementiPasivni elektronski elementi
Pasivni elektronski elementibbilja
 
atSistemas - Presentación Integración Continua AUG Barcelona enero13
atSistemas - Presentación Integración Continua AUG Barcelona enero13atSistemas - Presentación Integración Continua AUG Barcelona enero13
atSistemas - Presentación Integración Continua AUG Barcelona enero13atSistemas
 
AssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentationAssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentationAssureBridge
 
CIS 2015 SSO for Mobile and Web Apps Ashish Jain
CIS 2015 SSO for Mobile and Web Apps Ashish JainCIS 2015 SSO for Mobile and Web Apps Ashish Jain
CIS 2015 SSO for Mobile and Web Apps Ashish JainCloudIDSummit
 
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...ForgeRock
 
A CONTEMPLATION OF OPENIG DEEP THOUGHTS
A CONTEMPLATION OF OPENIG DEEP THOUGHTSA CONTEMPLATION OF OPENIG DEEP THOUGHTS
A CONTEMPLATION OF OPENIG DEEP THOUGHTSForgeRock
 
Engineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionEngineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionDavid Evans
 
Securing Access Through a Multi-Purpose Credential and Digital ID
Securing Access Through a Multi-Purpose Credential and Digital IDSecuring Access Through a Multi-Purpose Credential and Digital ID
Securing Access Through a Multi-Purpose Credential and Digital IDForgeRock
 
Webinar: OpenAM 12.0 - New Featurs
Webinar: OpenAM 12.0 - New FeatursWebinar: OpenAM 12.0 - New Featurs
Webinar: OpenAM 12.0 - New FeatursForgeRock
 
OpenIDM: An Introduction
OpenIDM: An IntroductionOpenIDM: An Introduction
OpenIDM: An IntroductionForgeRock
 
Information Security Lesson 9 - Keys - Eric Vanderburg
Information Security Lesson 9 - Keys - Eric VanderburgInformation Security Lesson 9 - Keys - Eric Vanderburg
Information Security Lesson 9 - Keys - Eric VanderburgEric Vanderburg
 
Identity Manager Opensource OpenIDM Architecture
Identity Manager Opensource OpenIDM ArchitectureIdentity Manager Opensource OpenIDM Architecture
Identity Manager Opensource OpenIDM ArchitectureAidy Tificate
 
Cryptography and PKI
Cryptography and PKICryptography and PKI
Cryptography and PKIRabei Hassan
 
CIS 2015 Mobile SSO
CIS 2015 Mobile SSOCIS 2015 Mobile SSO
CIS 2015 Mobile SSOAshish Jain
 
OpenDJ - An Introduction
OpenDJ - An IntroductionOpenDJ - An Introduction
OpenDJ - An IntroductionForgeRock
 

Viewers also liked (20)

Crypto With OpenSSL
Crypto With OpenSSLCrypto With OpenSSL
Crypto With OpenSSL
 
OpenSSL User Manual and Data Format
OpenSSL User Manual and Data FormatOpenSSL User Manual and Data Format
OpenSSL User Manual and Data Format
 
OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)OpenSSL programming (still somewhat initial version)
OpenSSL programming (still somewhat initial version)
 
Pki and OpenSSL
Pki and OpenSSLPki and OpenSSL
Pki and OpenSSL
 
Ssl Https Server
Ssl Https ServerSsl Https Server
Ssl Https Server
 
Pasivni elektronski elementi
Pasivni elektronski elementiPasivni elektronski elementi
Pasivni elektronski elementi
 
atSistemas - Presentación Integración Continua AUG Barcelona enero13
atSistemas - Presentación Integración Continua AUG Barcelona enero13atSistemas - Presentación Integración Continua AUG Barcelona enero13
atSistemas - Presentación Integración Continua AUG Barcelona enero13
 
AssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentationAssureBridge - SSO to Many B2B Service Providers - Marketing presentation
AssureBridge - SSO to Many B2B Service Providers - Marketing presentation
 
CIS 2015 SSO for Mobile and Web Apps Ashish Jain
CIS 2015 SSO for Mobile and Web Apps Ashish JainCIS 2015 SSO for Mobile and Web Apps Ashish Jain
CIS 2015 SSO for Mobile and Web Apps Ashish Jain
 
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
OpenIG Webinar: Your Swiss Army Knife for Protecting and Securing Web Apps, A...
 
A CONTEMPLATION OF OPENIG DEEP THOUGHTS
A CONTEMPLATION OF OPENIG DEEP THOUGHTSA CONTEMPLATION OF OPENIG DEEP THOUGHTS
A CONTEMPLATION OF OPENIG DEEP THOUGHTS
 
Engineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric EncryptionEngineering Cryptographic Applications: Symmetric Encryption
Engineering Cryptographic Applications: Symmetric Encryption
 
Securing Access Through a Multi-Purpose Credential and Digital ID
Securing Access Through a Multi-Purpose Credential and Digital IDSecuring Access Through a Multi-Purpose Credential and Digital ID
Securing Access Through a Multi-Purpose Credential and Digital ID
 
Webinar: OpenAM 12.0 - New Featurs
Webinar: OpenAM 12.0 - New FeatursWebinar: OpenAM 12.0 - New Featurs
Webinar: OpenAM 12.0 - New Featurs
 
OpenIDM: An Introduction
OpenIDM: An IntroductionOpenIDM: An Introduction
OpenIDM: An Introduction
 
Information Security Lesson 9 - Keys - Eric Vanderburg
Information Security Lesson 9 - Keys - Eric VanderburgInformation Security Lesson 9 - Keys - Eric Vanderburg
Information Security Lesson 9 - Keys - Eric Vanderburg
 
Identity Manager Opensource OpenIDM Architecture
Identity Manager Opensource OpenIDM ArchitectureIdentity Manager Opensource OpenIDM Architecture
Identity Manager Opensource OpenIDM Architecture
 
Cryptography and PKI
Cryptography and PKICryptography and PKI
Cryptography and PKI
 
CIS 2015 Mobile SSO
CIS 2015 Mobile SSOCIS 2015 Mobile SSO
CIS 2015 Mobile SSO
 
OpenDJ - An Introduction
OpenDJ - An IntroductionOpenDJ - An Introduction
OpenDJ - An Introduction
 

Similar to OpenSSL Basic Function Call Flow

maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingMax Kleiner
 
Nachos3 - Theoretical Part
Nachos3 - Theoretical PartNachos3 - Theoretical Part
Nachos3 - Theoretical PartEduardo Triana
 
How (un)secure is SSL/TLS?
How (un)secure is SSL/TLS?How (un)secure is SSL/TLS?
How (un)secure is SSL/TLS?Microsoft
 
Fire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsFire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsPriyanka Aash
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingMichelle Holley
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT Meetup
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -evechiportal
 
Java 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeJava 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeMartin Toshev
 
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf Conference
 
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...sonjeku1
 
API-openssl-apache.ppt
API-openssl-apache.pptAPI-openssl-apache.ppt
API-openssl-apache.pptwebhostingguy
 

Similar to OpenSSL Basic Function Call Flow (20)

maxbox starter72 multilanguage coding
maxbox starter72 multilanguage codingmaxbox starter72 multilanguage coding
maxbox starter72 multilanguage coding
 
Nachos3 - Theoretical Part
Nachos3 - Theoretical PartNachos3 - Theoretical Part
Nachos3 - Theoretical Part
 
How (un)secure is SSL/TLS?
How (un)secure is SSL/TLS?How (un)secure is SSL/TLS?
How (un)secure is SSL/TLS?
 
A.java
A.javaA.java
A.java
 
Fire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS FirewallsFire & Ice: Making and Breaking macOS Firewalls
Fire & Ice: Making and Breaking macOS Firewalls
 
TO Hack an ASP .NET website?
TO Hack an ASP .NET website?  TO Hack an ASP .NET website?
TO Hack an ASP .NET website?
 
Hack ASP.NET website
Hack ASP.NET websiteHack ASP.NET website
Hack ASP.NET website
 
Book
BookBook
Book
 
F5 tcpdump
F5 tcpdumpF5 tcpdump
F5 tcpdump
 
Python networking
Python networkingPython networking
Python networking
 
DPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet ProcessingDPDK & Layer 4 Packet Processing
DPDK & Layer 4 Packet Processing
 
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
Athens IoT meetup #7 - Create the Internet of your Things - Laurent Ellerbach...
 
Track c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eveTrack c-High speed transaction-based hw-sw coverification -eve
Track c-High speed transaction-based hw-sw coverification -eve
 
SSL/TLS
SSL/TLSSSL/TLS
SSL/TLS
 
Java 9 Security Enhancements in Practice
Java 9 Security Enhancements in PracticeJava 9 Security Enhancements in Practice
Java 9 Security Enhancements in Practice
 
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
ZFConf 2011: Что такое Sphinx, зачем он вообще нужен и как его использовать с...
 
Lab
LabLab
Lab
 
Computer Security
Computer SecurityComputer Security
Computer Security
 
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
us-17-Tsai-A-New-Era-Of-SSRF-Exploiting-URL-Parser-In-Trending-Programming-La...
 
API-openssl-apache.ppt
API-openssl-apache.pptAPI-openssl-apache.ppt
API-openssl-apache.ppt
 

More from William Lee

Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesWilliam Lee
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxWilliam Lee
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHPWilliam Lee
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 William Lee
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3William Lee
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)William Lee
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerWilliam Lee
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCapWilliam Lee
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding WindowWilliam Lee
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserWilliam Lee
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserWilliam Lee
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASPWilliam Lee
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginWilliam Lee
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationWilliam Lee
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5William Lee
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)William Lee
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web PageWilliam Lee
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 UsageWilliam Lee
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)William Lee
 

More from William Lee (20)

Usage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP LanguagesUsage Note of Apache Thrift for C++ Java PHP Languages
Usage Note of Apache Thrift for C++ Java PHP Languages
 
Usage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on LinuxUsage Note of Qt ODBC Database Access on Linux
Usage Note of Qt ODBC Database Access on Linux
 
Usage Note of SWIG for PHP
Usage Note of SWIG for PHPUsage Note of SWIG for PHP
Usage Note of SWIG for PHP
 
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5 Upgrade GCC & Install Qt 5.4 on CentOS 6.5
Upgrade GCC & Install Qt 5.4 on CentOS 6.5
 
Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3Usage Notes of The Bro 2.2 / 2.3
Usage Notes of The Bro 2.2 / 2.3
 
Viewing Android Source Files in Eclipse (Chinese)
Viewing Android Source Files in Eclipse  (Chinese)Viewing Android Source Files in Eclipse  (Chinese)
Viewing Android Source Files in Eclipse (Chinese)
 
Usage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency WalkerUsage Note of Microsoft Dependency Walker
Usage Note of Microsoft Dependency Walker
 
Usage Note of PlayCap
Usage Note of PlayCapUsage Note of PlayCap
Usage Note of PlayCap
 
Qt4 App - Sliding Window
Qt4 App - Sliding WindowQt4 App - Sliding Window
Qt4 App - Sliding Window
 
GTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App ChooserGTK+ 2.0 App - Desktop App Chooser
GTK+ 2.0 App - Desktop App Chooser
 
GTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon ChooserGTK+ 2.0 App - Icon Chooser
GTK+ 2.0 App - Icon Chooser
 
Note of CGI and ASP
Note of CGI and ASPNote of CGI and ASP
Note of CGI and ASP
 
Moblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) PluginMoblin2 - Window Manager(Mutter) Plugin
Moblin2 - Window Manager(Mutter) Plugin
 
MGCP Overview
MGCP OverviewMGCP Overview
MGCP Overview
 
Asterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log RotationAsterisk (IP-PBX) CDR Log Rotation
Asterisk (IP-PBX) CDR Log Rotation
 
L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5L.A.M.P Installation Note --- CentOS 6.5
L.A.M.P Installation Note --- CentOS 6.5
 
C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)C Program Runs on Wrong Target Platform(CPU Architecture)
C Program Runs on Wrong Target Platform(CPU Architecture)
 
Internationalization(i18n) of Web Page
Internationalization(i18n) of Web PageInternationalization(i18n) of Web Page
Internationalization(i18n) of Web Page
 
Notes for SQLite3 Usage
Notes for SQLite3 UsageNotes for SQLite3 Usage
Notes for SQLite3 Usage
 
Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)Cygwin Install How-To (Chinese)
Cygwin Install How-To (Chinese)
 

Recently uploaded

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 

Recently uploaded (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 

OpenSSL Basic Function Call Flow

  • 1. OpenSSL Basic Function Call Flow William.L wiliwe@gamil.com 2006-06-13
  • 2. Index Summary.......................................................................................................................................................... 3 OpenSSL Data Structures .............................................................................................................................. 4 genRANDOM() Function ............................................................................................................................. 10 Reference ....................................................................................................................................................... 17
  • 3. Summary Purpose This document provides a basic function calling flow of OpenSSL library for constructing a secure TCP connection to send/receive critical data. General Description The OpenSSL library implements the Secure Sockets Layer (SSL v2/v3) protocols. At first, the library must be initialized by calling the function : SSL_library_init() . Then an SSL_CTX object is created as a framework to establish TLS/SSL enabled connections. This object is created by calling the function : SSL_CTX_new(). Various options regarding certificates, algorithms etc. can be set in this object. When a network connection (e.g. TCP connection) has been created, it can be assigned to an SSL object. After the SSL object has been created using SSL_new(), SSL_set_fd() or SSL_set_bio() can be used to associate the network connection with the object. Then the TLS/SSL handshake is performed using SSL_accept() (for server side) or SSL_connect() (for client side) respectively. SSL_read() and SSL_write() are used to read and write data on the TLS/SSL connection. SSL_shutdown() can be used to shut down the TLS/SSL connection.
  • 4. OpenSSL Data Structures Currently the OpenSSL library functions deals with the following data structures: SSL_METHOD The SSL Method. That's a dispatch structure describing the internal SSL library methods/functions which implement the various protocol versions (SSLv1, SSLv2 and TLSv1). It's needed to create an SSL_CTX. Data Structure SSL_METHOD Definded in ssl.h File Location OpenSSL-Srcssl SSL_CIPHER The SSL Cipher. This structure holds the algorithm information for a particular cipher which are a core part of the SSL/TLS protocol. The available ciphers are configured on a SSL_CTX basis and the actually used ones are then part of the SSL_SESSION. Data Structure SSL_CIPHER Definded in ssl.h File Location OpenSSL-Srcssl SSL_CTX The SSL Context. That's the global context structure which is created by a server or client once per program life-time and which holds mainly default values for the SSL structures which are later created for the connections. Data Structure SSL_CTX Definded in ssl.h File Location OpenSSL-Src ssl SSL_SESSION The SSL Session . This is a structure containing the current TLS/SSL session details for a connection: SSL_CIPHER, client and server certificates, keys, etc. Data Structure SSL_SESSION Definded in ssl.h File Location OpenSSL-Src ssl SSL The SSL Connection . That's the main SSL/TLS structure which is created by a server or client per established connection. This actually is the core structure in the SSL API. Under run-time the application usually deals with this structure which has links to mostly all other structures.
  • 5. Data Structure SSL Definded in ssl.h File Location OpenSSL-Src ssl
  • 6. Basic Calling Flow int SSL_library_init(void) Initializing the OpenSSL library. call SSL_METHOD *SSLv23_method(void) Constructor for the SSLv2 or SSLv3 SSL_METHOD structure for combined client and server. call SSL_CTX* SSL_CTX_new(SSL_METHOD *method) SSL_CTX object is created as a framework to establish TLS/SSL enabled connections. call RAND_add() : Load the Randomness This step is for initializing the randomness for generating session key (client key). This phase will do automatically with RAND_poll() function which will call RAND_add() indirectly in below O.S platform: <1>OS2 <2>Unix <3>OpenBSD <4>Linux <5>Windows. If the platform other than the above, we must call RAND_add() explicitly. For example, in VxWorks RTOS, it must call RAND_add() explicitly. call
  • 7. call Creates a TCP connection. { This will generate a socket handler,e.g. file descriptor } call SSL* SSL_new(SSL_CTX *ctx) Creates a new SSL structure which is needed to hold the data for a TLS/SSL connection. call int SSL_set_fd (SSL *ssl, int fd) Sets the file descriptor fd as the input/output facility for the TLS/SSL (encrypted) side of ssl. fd will typically be the socket file descriptor of a network connection. call call Is this a Server application Yes, this is a Server application call No, this is a Client application int SSL_connect(SSL *ssl) Initiates the TLS/SSL handshake with a server. SSL Handshaking int SSL_accept(SSL *ssl) Waits for a TLS/SSL client to initiate the TLS/SSL handshake. Successful Handshaking
  • 8. int SSL_read(SSL*ssl, void *buf, int num) Tries to read num bytes from the specified ssl into the buffer buf. int SSL_write(SSL *ssl, const void *buf, int num) Writes num bytes from the buffer buf into the specified SSL connection, ssl. from read from write Need to terminating the SSL connection? No, continues to use the active SSL connection. Yes, terminate the SSL connection int SSL_shutdown(SSL *ssl) Shuts down an active TLS/SSL connection. It sends the “close notify” shutdown alert to the peer. Going back to the SSL read/write operation call int SSL_free(SSL *ssl) Decrements the reference count of ssl, and removes the SSL structure pointed to by ssl and frees up the allocated memory if the the reference count has reached 0. call read operation? call No, this is a write operation call Yes, this is a read operation Successful Handshaking
  • 9. call int SSL_CTX_free(SSL_CTX *ctx) Decrements the reference count of ctx, and removes the SSL_CTX object pointed to by ctx and frees up the allocated memory if the the reference count has reached 0. It also calls free() to release memory of items(if it is available): session cache, list of ciphers, list of Client CAs, certificates and keys. call int close(int socket) This the socket function to close a socket and terminate a TCP connection. Finish The above function call flow is just a basic flow to create a SSL connection without client authentication and doing read/write operations.
  • 10. genRANDOM() Function This is a randomness initialization function we created. It calls the OpenSSL function, RAND_add(), to accomplish the randomness initialization operation(that is to seed unpredictable data to a cryptographic PRNG (Pseudo-Random Number Generator). The function signature is : void RAND_add (const void *buf, int num, double entropy) The followings are the steps showing how to use RAND_add() function to initailize randomness. Step 1) We created a string type variable and fill arbitrary chars (the content should be unpredictable that any one can’t guess it). In our codes, we do as below : static char* strRANDOM = "FreeBSD -STABLE #4: Tue g5 15:50:0PDT000 Tiecounti8254 frequen193182 Hz CP: Pent II/Xeon/Celeron400.MHz 6-cls CPU) Prbing fdevices on PCI b: chp0: <Il 82443BX host tI bri> v 02 on pci0.0.0 Prbing fPnP devices: sc: VGA or <16 virtualoles, flagsx0> ed not fd at 0x280 ah0 not nd at 0x34 ai0 not nd vg0 at 00-0x3df madd000 msize 1372 on isa"; Step 2) Now, we start use RAND_add() function to seed PRNG. The using is shown below :
  • 11. for(;;) { if (Bytes > 0) n = (Bytes < BUFSIZ)?(int)Bytes:BUFSIZ; else n = BUFSIZ; while( (i = rand()%1000-13) ==0) ; strncpy(buf, (strRANDOM+offset), i); RAND_add (buf, n, i); offset += i; if (offset>=(len+1)) break; if (Bytes > 0) { Bytes -= n; if (Bytes <= 0) break; } /*if(Bytes)*/ } /* for(;;) */
  • 12. The complete genRANDOM() body is : #define BUFSIZ 1024 static void genRANDOM() { long Bytes = 1024*10; int i =0, offset=0, n=0, len=strlen(strRANDOM); char buf[BUFSIZ]; printf("[CWMP] genRANDOM()n"); memset(buf, 0, BUFSIZ); for(;;) { if (Bytes > 0) n = (Bytes < BUFSIZ)?(int)Bytes:BUFSIZ; else n = BUFSIZ; while( (i = rand()%1000-13) ==0) ; strncpy(buf, (strRANDOM+offset), i); RAND_add (buf, n, i); offset += i; if (offset>=(len+1)) break; if (Bytes > 0) { Bytes -= n; if (Bytes <= 0) break; } } /* End of for(;;) */ } /* End of genRAND() */
  • 13. SSL Client Side Example Codes #include "openssl/bio.h" #include "openssl/crypto.h" #include "openssl/x509.h" #include "openssl/ssl.h" #include "openssl/err.h" /* For error message */ #include “openssl/rand.h” /* For RAND_add() */ #define BUFSIZZ 2048 /*================ Global variables ================*/ static char *hostIP = "10.1.25.162"; struct sockaddr_in addr; /* socket address */ int sock = 0; /* socket */ unsigned int hp = 0; /* for host IP address */ int ret= 0, request_len, len; char buf[BUFSIZZ]; SSL_METHOD *meth = NULL; SSL_CTX *ctx = NULL; BIO *sbio = NULL; /*===================== SSL Initialization =====================*/ SSL_library_init(); /* Initializing the SSL libraries */ SSL_load_error_strings(); /* Loading the error message string for each error code */ meth = SSLv23_method(); /* Init the methods for handshaking and accessing SSL data */ ctx = SSL_CTX_new(meth); /* Create a SSL context */ genRANDOM(); printf("SSL Init Done!n"); /* Resolving the IP address of the target host */ if ( (hp=hostGetByName((char*)hostIP)) == ERROR) /* hostGetByName() calls gethostbyname()*/ { /* socket interface */ printf ("Couldn't resolve host"); exit (1); } /* Setting the network address structure */ memset (&addr, 0, sizeof(addr)); addr.sin_addr.s_addr = INADDR_ANY; addr.sin_family = AF_INET; addr.sin_port = htons (443); /* Well-known port number for HTTPS */
  • 14. /* Get the socket */ if ( (sock = socket(AF_INET,SOCK_STREAM, IPPROTO_TCP))<0 ) { fprintf(stderr, "Couldn't create socket"); exit(1); } /*================ Try to create the TCP connection ================*/ if ( connect(sock, (struct sockaddr *)&addr, sizeof(addr))<0 ) { fprintf(stderr, "Couldn't connect socket"); exit(1); } printf("The TCP Connection is created!n"); /*================ Create the SSL connection context ================*/ ssl = SSL_new (ctx); sbio = BIO_new_socket (sock, BIO_NOCLOSE); SSL_set_bio (ssl, sbio, sbio); printf("Starting to do SSL Handshaking…n"); if ( SSL_connect (ssl) <= 0 ) /* Note: at this point it is in blocking mode */ { char errstr[256]; int sslres; printf("SSL handshaking fail!n"); sslres = SSL_get_error (ssl, res); ERR_error_string_n (sslres, errstr,s 256); /* Convert the error code to the man readable error string. */ printf(“The SSL error is %d => %sn”, sslres, errstr); exit(1); } char* httpRequest = ”GET /top.html HTTP/1.0rnUser-Agent:" "HTTP_ClientrnHost: 10.1.25.162:443rnrn”; request_len = strlen (httpRequest ); ret = SSL_write(ssl, httpRequest , request_len); /* Send out the HTTP request message */ switch ( SSL_get_error(ssl, ret) )
  • 15. { case SSL_ERROR_NONE : if ( request_len != ret ) { fprintf(stderr, "Incomplete write!"); exit(1); } break; default: fprintf(stderr, "SSL write problem"); exit(1); } /* End of switch */ /* Now read the server's response, assuming that it's terminated by a close */ while (1) { ret = SSL_read (ssl, buf, BUFSIZZ); switch ( SSL_get_error (ssl, ret)) { case SSL_ERROR_NONE: len=ret; break; case SSL_ERROR_WANT_READ: continue; case SSL_ERROR_ZERO_RETURN: goto shutdown; case SSL_ERROR_SYSCALL: fprintf(stderr,"SSL Error: Premature closen"); goto done; default: { fprintf(stedrr, "SSL read problem"); exit(1); } } /* End of switch */ printf("Content = n%sn", buf); } /* End of while(1) */ shutdown: ret = SSL_shutdown (ssl); /* Send “Close” notify to the HTTP server */ switch(ret) { case 1: break; /* Success */
  • 16. case 0: case -1: default: { fprintf(stderr, "Shutdown failed"); exit(1); } } /* End of switch */ done: SSL_free(ssl); SSL_CTX_free (ctx); close(sock); /* Send “Close” notify to the HTTP server */ /*~~~~~~~~~~~~~~~~~~~ End of SSL client side example codes ~~~~~~~~~~~~~~~~~~~*/
  • 17. Reference * OpenSSL, http://www.openssl.org/ * http://www.openssl.org/docs/apps/ * http://www.openssl.org/docs/crypto/ * http://www.openssl.org/docs/ssl/ * PRNG implementation interface of OpenSSL http://www.openssl.org/docs/crypto/rand.html * RAND_add function how-to http://www.openssl.org/docs/crypto/RAND_add.html * Randomness Recommendations for Security http://www.potaroo.net/ietf/rfc/rfc1750.txt