22.10.2013 Views

System i: Programming Secure Sockets APIs - IBM

System i: Programming Secure Sockets APIs - IBM

System i: Programming Secure Sockets APIs - IBM

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Parameters<br />

SSLHandle* handle (input)<br />

The pointer to an SSLHandle for an SSL session. An SSLHandle is a typedef for a buffer of type<br />

struct SSLHandleStr. In , struct SSLHandleStr is defined as the following:<br />

struct SSLHandleStr { /* SSLHandleStr */<br />

int fd; /* Socket descriptor */<br />

int createFlags; /* SSL_Create flags value */<br />

unsigned protocol; /* SSL protocol version */<br />

unsigned timeout; /* Timeout value in seconds */<br />

unsigned char cipherKind[3]; /* Current 2.0 cipher suite*/<br />

unsigned short int cipherSuite; /* Current 3.0 cipher suite */<br />

unsigned short int* cipherSuiteList; /* List of cipher suites */<br />

unsigned int cipherSuiteListLen; /* Number of entries in<br />

the cipher suites list */<br />

unsigned char* peerCert; /* Peer certificate */<br />

unsigned peerCertLen; /* Peer certificate length */<br />

int peerCertValidateRc; /* Return code from<br />

validation of certficate */<br />

int (*exitPgm)(struct SSLHandleStr* sslh);<br />

/* Authentication exit<br />

program called when a<br />

certificate is received<br />

during SSL handshake */<br />

};<br />

void *buffer (input)<br />

A pointer to the user-supplied buffer in which the data that is received on the SSL session is to be<br />

stored.<br />

int buffer_length (input)<br />

The length of the buffer.<br />

Authorities<br />

No authorization is required.<br />

Return Value<br />

The SSL_Read() API returns an integer. Possible values are:<br />

[n]<br />

Successful, where n is the number of bytes read.<br />

[SSL_ERROR_BAD_MESSAGE]<br />

SSL received a badly formatted message.<br />

[SSL_ERROR_BAD_MAC]<br />

A bad message authentication code was received.<br />

[SSL_ERROR_BAD_MALLOC]<br />

Unable to allocate storage required for SSL processing.<br />

[SSL_ERROR_BAD_STATE]<br />

SSL detected a bad state in the SSL session.<br />

[SSL_ERROR_CLOSED]<br />

The SSL session ended.<br />

92 <strong>System</strong> i: <strong>Programming</strong> <strong>Secure</strong> <strong>Sockets</strong> <strong>APIs</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!