gsk_attribute_get_buffer()--Get character information about a secure session or an SSL environment


  Syntax
 #include <gskssl.h>

 int gsk_attribute_get_buffer(gsk_handle my_gsk_handle,
                              GSK_BUF_ID bufID,
                              const char **buffer,
                              int *bufSize);

  Service Program Name: QSYS/QSOSSLSR

  Default Public Authority: *USE

  Threadsafe: Yes

The gsk_attribute_get_buffer() function is used to obtain specific character string information about a secure session or an SSL environment. It can be used to obtain values such as certificate store file, certificate store password, application ID, and ciphers.


Parameters

my_gsk_handle (Input)
Indicates one of the following handles:
bufID (Input)
The following values can be used to retrieve information about the secure session or the SSL environment that is either defaulted or explicitly set:


buffer (Output)
The address of the location to place the pointer that will point to the buffer containing the requested information. The storage for this information was allocated by the system from user heap storage and will be freed by the gsk_secure_soc_close() API or the gsk_environment_close() API.

The data in the buffer is assumed to be represented in the CCSID (coded character set identifier) currently in effect for the job. If the CCSID of the job is 65535, this buffer is assumed to be represented in the default CCSID of the job.

bufSize (Output)
The address of the location to store the length of the requested information pointed to by buffer.

Authorities

No authorization is required.


Return Value

gsk_attribute_get_buffer()

returns an integer. Possible values are:

[GSK_OK]
gsk_attribute_get_buffer() was successful.

[GSK_ATTRIBUTE_INVALID_ID]
The specified bufID was not valid.

[GSK_INVALID_HANDLE]
The specified handle was not valid.

[GSK_AS400_ERROR_INVALID_POINTER]
The buffer or bufSize pointer is not valid.

[GSK_ERROR_UNSUPPORTED]
The bufID currently is not supported.

[GSK_ERROR_IO]
An error occurred in SSL processing. Check the errno value.

Error Conditions

When the gsk_attribute_get_buffer() API fails with return code [GSK_ERROR_IO], errno can be set to:

[EINTR] Interrupted function call.
[EDEADLK] Resource deadlock avoided.
[ETERM] Operation terminated.

If an errno is returned that is not in this list, look in Errno Values for UNIX®-Type Functions for a description of the errno.


Usage Notes

  1. The following GSK_BUF_ID values may be retrieved from the SSL environment after gsk_environment_open().


  2. The following GSK_BUF_ID values may be retrieved from the secure session after gsk_secure_soc_open().


  3. The following GSK_BUF_ID values are defaulted after gsk_secure_soc_open() and will be set for the secure session after gsk_secure_soc_init().
  4. The following GSK_BUF_ID values may be changed for the secure session after gsk_secure_soc_misc(), gsk_secure_soc_read() or gsk_secure_soc_startRecv() if an SSL Handshake happened under the context of those calls for the secure session.
  5. The buffer pointer can be referenced as long as the handle for the secure session or the SSL environment is still open.

  6. Start of change When GSK_OS400_APPLICATION_ID is set, the settings of some of the SSL environment attributes will be determined by the corresponding value in the Application ID definition in Digital Certificate Manager (DCM). These are the buffer attributes that can be overwritten by DCM during the call to gsk_environment_init():
  7. When GSK_OS400_APPLICATION_ID is set, the settings of some of the SSL environment attributes will be affected by the corresponding value in the Application ID definition in Digital Certificate Manager (DCM). These are the buffer attributes that can be appended by DCM to the end of the existing SSL environment buffer attributes during the call to gsk_environment_init(): End of change

  8. The following GSK_BUF_ID values currently are not supported in the IBM® i implementation:



Related Information



API introduced: V5R1
Top | UNIX-Type APIs | APIs by category