RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

Buffer Functions

This section details the functions that are used to manipulate the read and write buffers.

Functions

int R_CDECL SSL_set_message_size (SSL *ssl, int cmd, long size)
 Sets the memory pre-allocation for messages received in the SSLv3 handshake. More...

long R_CDECL SSL_get_message_size (SSL *ssl, int cmd)
 Returns the size of the memory allocated for messages received in an SSLv3 handshake. More...

int R_CDECL SSL_set_write_buf_size (SSL *ssl, int size)
 Sets the size of the current write buffer for the SSL connection ssl that is allocated to hold an SSL record. More...

int R_CDECL SSL_get_write_buf_size (SSL *ssl)
 Returns the size of the current write buffer for the SSL connection ssl that is allocated to hold an SSL record. More...

int R_CDECL SSL_set_read_buf_size (SSL *ssl, int size)
 Sets the size of the initial read buffer for the ssl that is allocated to hold an SSL record. More...

int R_CDECL SSL_get_read_buf_size (SSL *ssl)
 Returns the size of the current read buffer for the SSL connection ssl that is allocated to hold an SSL record. More...

int R_CDECL SSL_CTX_set_message_size (SSL_CTX *ctx, int cmd, long size)
 Sets the memory pre-allocation for messages received in an SSLv3 handshake for the SSL_CTX ctx. More...

long R_CDECL SSL_CTX_get_message_size (SSL_CTX *ctx, int cmd)
 Returns the size of the memory allocated for messages received in an SSLv3 handshake. More...

int R_CDECL SSL_CTX_set_write_buf_size (SSL_CTX *ctx, int size)
 Sets the default size of the initial write buffer that is allocated for an SSL structure to hold an SSL record. More...

int R_CDECL SSL_CTX_get_write_buf_size (SSL_CTX *ctx)
 Returns the default size of the initial write buffer that is created for each SSL structure for the SSL_CTX ctx. More...

int R_CDECL SSL_CTX_set_read_buf_size (SSL_CTX *ctx, int size)
 Sets the default size of the initial read buffer that is allocated for an SSL structure to hold an SSL record. More...

int R_CDECL SSL_CTX_get_read_buf_size (SSL_CTX *ctx)
 Returns the default size of the initial read buffer that is created with an SSL structure generated for the SSL_CTX ctx. More...

void R_CDECL SSL_CTX_set_read_ahead (SSL_CTX *ssl, int yes)
 Sets the read ahead-flag value of SSL_CTX. More...

int R_CDECL SSL_CTX_get_read_ahead (SSL_CTX *ssl)
 Returns the read-ahead flag value from the SSL_CTX. More...


Function Documentation

long R_CDECL SSL_CTX_get_message_size SSL_CTX   ctx,
int    cmd
;
 

Returns the size of the memory allocated for messages received in an SSLv3 handshake.

Parameters:
ctx [In] The SSL_CTX reference from which to retrieve the default message size.
cmd [In] The memory allocation. One of:
  • SSL_SZ_CLIENT_CERT.
  • SSL_SZ_SERVER_CERT.
  • Returns:
    >0 indicates the message size in Bytes.
    0 indicates error.
    See also:
    SSL_CTX_set_message_size().

    int R_CDECL SSL_CTX_get_read_ahead SSL_CTX   ctx ;
     

    Returns the read-ahead flag value from the SSL_CTX. The read-ahead flag controls whether more data is read from the network than requested (if it is previously determined to be available). This option can be used to achieve significant throughput improvement.

    Parameters:
    ctx [In] The SSL_CTX structure against which read ahead is to be returned.
    Returns:
    0 indicates the flag is not set.
    Otherwise indicates flag is set.
    note.gif
    Ensure that ctx is not NULL.
    See also:
    SSL_CTX_set_read_ahead().

    int R_CDECL SSL_CTX_get_read_buf_size SSL_CTX   ctx ;
     

    Returns the default size of the initial read buffer that is created with an SSL structure generated for the SSL_CTX ctx.

    Parameters:
    ctx [In] The SSL_CTX reference from which to retrieve the default read buffer size.
    Returns:
    The initial buffer size.
    See also:
    SSL_CTX_set_read_buf_size() and SSL_get_read_buf_size().

    int R_CDECL SSL_CTX_get_write_buf_size SSL_CTX   ctx ;
     

    Returns the default size of the initial write buffer that is created for each SSL structure for the SSL_CTX ctx.

    Parameters:
    ctx [In] The SSL_CTX reference from which to retrieve the default write buffer size.
    Returns:
    The initial buffer size.
    See also:
    SSL_CTX_set_write_buf_size() and SSL_get_write_buf_size().

    int R_CDECL SSL_CTX_set_message_size SSL_CTX   ctx,
    int    cmd,
    long    size
    ;
     

    Sets the memory pre-allocation for messages received in an SSLv3 handshake for the SSL_CTX ctx.

    Parameters:
    ctx [In] The SSL_CTX reference against which to set the message size.
    cmd [In] The memory allocation to perform.
    See Message Size Identifiers for valid values.
    size [In] The message size in Bytes.
    Returns:
    1 indicates success.
    0 indicates error.
    note.gif
    SSL_SZ_SERVER_CERT affects the amount of memory allocated for key exchange and certificate request messages in a handshake. These messages are optional or situation-dependent and are not always sent.
    See also:
    SSL_CTX_get_message_size().

    void R_CDECL SSL_CTX_set_read_ahead SSL_CTX   ctx,
    int    yes
    ;
     

    Sets the read ahead-flag value of SSL_CTX. The read-ahead flag controls whether more data is read from the network than requested (if it is previously determined to be available). This option can be used to achieve significant throughput improvement.

    Parameters:
    ctx [In, Out] The SSL_CTX structure against which to set the read ahead.
    yes [In] The read-ahead flag:
    0 indicates to clear the flag.
    > 0 indicates to set the flag.
    note.gif
    The user should ensure that ctx is not NULL.
    See also:
    SSL_CTX_get_read_ahead().

    int R_CDECL SSL_CTX_set_read_buf_size SSL_CTX   ctx,
    int    size
    ;
     

    Sets the default size of the initial read buffer that is allocated for an SSL structure to hold an SSL record. The new buffer size applies to all SSL structures that are subsequently created for the SSL_CTX ctx.

    Parameters:
    ctx [In] The SSL_CTX reference against which to set the default read buffer size.
    size [In] The buffer size.
    Returns:
    The current default size for the initial read buffer.
    -1 indicates the buffer size requested is too small.
    note.gif
    The buffer size cannot be set to less than 128 Bytes.
    See also:
    SSL_CTX_get_read_buf_size().

    int R_CDECL SSL_CTX_set_write_buf_size SSL_CTX   ctx,
    int    size
    ;
     

    Sets the default size of the initial write buffer that is allocated for an SSL structure to hold an SSL record. The new buffer size applies to all SSL structures that are subsequently created for the SSL_CTX ctx.

    Parameters:
    ctx [In] The SSL_CTX reference against which to set the default write buffer size.
    size [In] The buffer size.
    Returns:
    The current default size for the initial write buffer.
    -1 indicates the requested buffer size is too small.
    note.gif
    The buffer size cannot be set smaller than 128 Bytes.
    See also:
    SSL_CTX_get_write_buf_size().
    Samples:
    simple.c.

    long R_CDECL SSL_get_message_size SSL   ssl,
    int    cmd
    ;
     

    Returns the size of the memory allocated for messages received in an SSLv3 handshake.

    Parameters:
    ssl [In] The SSL connection reference from which to retrieve the message size.
    cmd [In] The memory allocation to retrieve. One of:
  • SSL_SZ_CLIENT_CERT.
  • SSL_SZ_SERVER_CERT.
  • Returns:
    >0 indicates the message size in Bytes.
    0 indicates error.
    See also:
    SSL_set_message_size().

    int R_CDECL SSL_get_read_buf_size SSL   ssl ;
     

    Returns the size of the current read buffer for the SSL connection ssl that is allocated to hold an SSL record. The buffer is automatically expanded to handle incoming SSL records.

    Parameters:
    ssl [In] The SSL connection reference from which to retrieve the read buffer size.
    Returns:
    The buffer size.
    note.gif
    The initial buffer size is taken from the value maintained by the SSL_CTX.
    See also:
    SSL_set_read_buf_size() and SSL_CTX_set_read_buf_size().

    int R_CDECL SSL_get_write_buf_size SSL   ssl ;
     

    Returns the size of the current write buffer for the SSL connection ssl that is allocated to hold an SSL record. The buffer is automatically expanded to handle incoming SSL records.

    Parameters:
    ssl [In] The SSL connection reference from which to retrieve the write buffer size.
    Returns:
    The buffer size in Bytes.
    note.gif
    The initial buffer size is taken from the value kept by the SSL_CTX.
    See also:
    SSL_set_write_buf_size() and SSL_CTX_set_write_buf_size().

    int R_CDECL SSL_set_message_size SSL   ssl,
    int    cmd,
    long    size
    ;
     

    Sets the memory pre-allocation for messages received in the SSLv3 handshake.

    Parameters:
    ssl [In] The SSL connection reference against which to set the message size.
    cmd [In] The memory allocation to perform.
    See Message Size Identifiers for valid values.
    size [In] The message size in Bytes.
    Returns:
    1 indicates success.
    0 indicates error.
    note.gif
    SSL_SZ_SERVER_CERT affects the amount of memory allocated for key exchange and certificate request messages in a handshake. These messages are optional or situation-dependent and are not always sent.
    See also:
    SSL_get_message_size().

    int R_CDECL SSL_set_read_buf_size SSL   ssl,
    int    size
    ;
     

    Sets the size of the initial read buffer for the ssl that is allocated to hold an SSL record. The buffer is automatically expanded to handle incoming SSL records.

    Parameters:
    ssl [In] The SSL connection reference against which to set the read buffer size.
    size [In] The buffer size.
    Returns:
    The previous buffer size.
    -1 indicates the requested buffer size is too small.
    note.gif
    The buffer should be set before an initial SSL_read() or SSL_write() call is made. Because buffer sizes are automatically expanded, data may be lost if the buffers are manually changed during an SSL session. Also the buffer size cannot be set smaller than 128 Bytes.
    See also:
    SSL_get_read_buf_size() and SSL_CTX_set_read_buf_size().

    int R_CDECL SSL_set_write_buf_size SSL   ssl,
    int    size
    ;
     

    Sets the size of the current write buffer for the SSL connection ssl that is allocated to hold an SSL record. The buffer is automatically expanded to handle incoming SSL records.

    Parameters:
    ssl [In] The SSL connection reference against which to set the write buffer size.
    size [In] The buffer size.
    Returns:
    The current write buffer size.
    -1 indicates the requested buffer size is too small.
    note.gif
    The buffer should be set before an initial SSL_read() or SSL_write() call is made. Because buffer sizes are automatically expanded, data may be lost if the buffers are manually changed during an SSL session. Also the buffer size cannot be set smaller than 128 Bytes.
    See also:
    SSL_get_write_buf_size() and SSL_CTX_set_write_buf_size().


    Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1