mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Merge pull request #3221 from julek-wolfssl/wolfSSL_dtls_import-const-buf
Change buffer in wolfSSL_dtls_import to be const
This commit is contained in:
@ -629,7 +629,7 @@ static int ExportKeyState(WOLFSSL* ssl, byte* exp, word32 len, byte ver,
|
|||||||
return idx;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ImportCipherSpecState(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
static int ImportCipherSpecState(WOLFSSL* ssl, const byte* exp, word32 len, byte ver)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
CipherSpecs* specs;
|
CipherSpecs* specs;
|
||||||
@ -666,7 +666,7 @@ static int ImportCipherSpecState(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int ImportKeyState(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
static int ImportKeyState(WOLFSSL* ssl, const byte* exp, word32 len, byte ver)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
byte sz;
|
byte sz;
|
||||||
@ -962,7 +962,7 @@ static int dtls_export_new(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
|||||||
|
|
||||||
/* copy items from Export struct to Options struct
|
/* copy items from Export struct to Options struct
|
||||||
* On success returns size of buffer used on failure returns a negative value */
|
* On success returns size of buffer used on failure returns a negative value */
|
||||||
static int dtls_export_load(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
static int dtls_export_load(WOLFSSL* ssl, const byte* exp, word32 len, byte ver)
|
||||||
{
|
{
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
Options* options = &ssl->options;
|
Options* options = &ssl->options;
|
||||||
@ -1144,7 +1144,7 @@ static int ExportPeerInfo(WOLFSSL* ssl, byte* exp, word32 len, byte ver)
|
|||||||
#endif /* !WOLFSSL_SESSION_EXPORT_NOPEER */
|
#endif /* !WOLFSSL_SESSION_EXPORT_NOPEER */
|
||||||
|
|
||||||
|
|
||||||
static int ImportPeerInfo(WOLFSSL* ssl, byte* buf, word32 len, byte ver)
|
static int ImportPeerInfo(WOLFSSL* ssl, const byte* buf, word32 len, byte ver)
|
||||||
{
|
{
|
||||||
word16 idx = 0;
|
word16 idx = 0;
|
||||||
word16 ipSz;
|
word16 ipSz;
|
||||||
@ -1346,7 +1346,7 @@ int wolfSSL_dtls_export_internal(WOLFSSL* ssl, byte* buf, word32 sz)
|
|||||||
|
|
||||||
|
|
||||||
/* On success return amount of buffer consumed */
|
/* On success return amount of buffer consumed */
|
||||||
int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl, byte* buf, word32 sz)
|
int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl, const byte* buf, word32 sz)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
word16 length = 0;
|
word16 length = 0;
|
||||||
@ -1413,12 +1413,12 @@ int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl, byte* buf, word32 sz)
|
|||||||
idx += ret;
|
idx += ret;
|
||||||
|
|
||||||
WOLFSSL_LEAVE("wolfSSL_dtls_import_state_internal", ret);
|
WOLFSSL_LEAVE("wolfSSL_dtls_import_state_internal", ret);
|
||||||
return ret;
|
return idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* On success return amount of buffer consumed */
|
/* On success return amount of buffer consumed */
|
||||||
int wolfSSL_dtls_import_internal(WOLFSSL* ssl, byte* buf, word32 sz)
|
int wolfSSL_dtls_import_internal(WOLFSSL* ssl, const byte* buf, word32 sz)
|
||||||
{
|
{
|
||||||
word32 idx = 0;
|
word32 idx = 0;
|
||||||
word16 length = 0;
|
word16 length = 0;
|
||||||
|
@ -191,7 +191,7 @@ byte tsip_rootCAverified( );
|
|||||||
|
|
||||||
#ifdef WOLFSSL_SESSION_EXPORT
|
#ifdef WOLFSSL_SESSION_EXPORT
|
||||||
#ifdef WOLFSSL_DTLS
|
#ifdef WOLFSSL_DTLS
|
||||||
int wolfSSL_dtls_import(WOLFSSL* ssl, unsigned char* buf, unsigned int sz)
|
int wolfSSL_dtls_import(WOLFSSL* ssl, const unsigned char* buf, unsigned int sz)
|
||||||
{
|
{
|
||||||
WOLFSSL_ENTER("wolfSSL_session_import");
|
WOLFSSL_ENTER("wolfSSL_session_import");
|
||||||
|
|
||||||
|
@ -1634,14 +1634,14 @@ WOLFSSL_LOCAL ProtocolVersion MakeTLSv1_3(void);
|
|||||||
WOLFSSL_LOCAL ProtocolVersion MakeDTLSv1_2(void);
|
WOLFSSL_LOCAL ProtocolVersion MakeDTLSv1_2(void);
|
||||||
|
|
||||||
#ifdef WOLFSSL_SESSION_EXPORT
|
#ifdef WOLFSSL_SESSION_EXPORT
|
||||||
WOLFSSL_LOCAL int wolfSSL_dtls_import_internal(WOLFSSL* ssl, byte* buf,
|
WOLFSSL_LOCAL int wolfSSL_dtls_import_internal(WOLFSSL* ssl, const byte* buf,
|
||||||
word32 sz);
|
word32 sz);
|
||||||
WOLFSSL_LOCAL int wolfSSL_dtls_export_internal(WOLFSSL* ssl, byte* buf,
|
WOLFSSL_LOCAL int wolfSSL_dtls_export_internal(WOLFSSL* ssl, byte* buf,
|
||||||
word32 sz);
|
word32 sz);
|
||||||
WOLFSSL_LOCAL int wolfSSL_dtls_export_state_internal(WOLFSSL* ssl,
|
WOLFSSL_LOCAL int wolfSSL_dtls_export_state_internal(WOLFSSL* ssl,
|
||||||
byte* buf, word32 sz);
|
byte* buf, word32 sz);
|
||||||
WOLFSSL_LOCAL int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl,
|
WOLFSSL_LOCAL int wolfSSL_dtls_import_state_internal(WOLFSSL* ssl,
|
||||||
byte* buf, word32 sz);
|
const byte* buf, word32 sz);
|
||||||
WOLFSSL_LOCAL int wolfSSL_send_session(WOLFSSL* ssl);
|
WOLFSSL_LOCAL int wolfSSL_send_session(WOLFSSL* ssl);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
@ -743,7 +743,7 @@ typedef int (*wc_dtls_export)(WOLFSSL* ssl,
|
|||||||
#define WOLFSSL_DTLS_EXPORT_TYPES
|
#define WOLFSSL_DTLS_EXPORT_TYPES
|
||||||
#endif /* WOLFSSL_DTLS_EXPORT_TYPES */
|
#endif /* WOLFSSL_DTLS_EXPORT_TYPES */
|
||||||
|
|
||||||
WOLFSSL_API int wolfSSL_dtls_import(WOLFSSL* ssl, unsigned char* buf,
|
WOLFSSL_API int wolfSSL_dtls_import(WOLFSSL* ssl, const unsigned char* buf,
|
||||||
unsigned int sz);
|
unsigned int sz);
|
||||||
WOLFSSL_API int wolfSSL_CTX_dtls_set_export(WOLFSSL_CTX* ctx,
|
WOLFSSL_API int wolfSSL_CTX_dtls_set_export(WOLFSSL_CTX* ctx,
|
||||||
wc_dtls_export func);
|
wc_dtls_export func);
|
||||||
|
Reference in New Issue
Block a user