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.

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 to be written is stored.<br />

int buffer_length (input)<br />

The length of the buffer.<br />

Authorities<br />

No authorization is required.<br />

Return Value<br />

SSL_Write() returns an integer. Possible values are:<br />

[n]<br />

Successful, where n is the number of bytes written.<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 />

[SSL_ERROR_IO]<br />

An error occurred in SSL processing; check the errno value.<br />

[SSL_ERROR_UNKNOWN]<br />

An unknown or unexpected error occurred during SSL processing.<br />

Error Conditions<br />

When the SSL_Write() API fails with return code [SSL_ERROR_IO], errno can be set to to one of the<br />

following:<br />

[EBADF]<br />

[EFAULT]<br />

Descriptor not valid.<br />

98 <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!