diff --git a/include/polarssl/net.h b/include/polarssl/net.h index 725babef6..c02dbd286 100644 --- a/include/polarssl/net.h +++ b/include/polarssl/net.h @@ -143,7 +143,7 @@ int net_recv( void *ctx, unsigned char *buf, size_t len ); * or a non-zero error code; POLARSSL_ERR_NET_WANT_WRITE * indicates write() is blocking. */ -int net_send( void *ctx, unsigned char *buf, size_t len ); +int net_send( void *ctx, const unsigned char *buf, size_t len ); /** * \brief Gracefully shutdown the connection diff --git a/include/polarssl/ssl.h b/include/polarssl/ssl.h index 1108b8b79..5a699ccba 100644 --- a/include/polarssl/ssl.h +++ b/include/polarssl/ssl.h @@ -231,7 +231,7 @@ struct _ssl_context int (*f_rng)(void *); void (*f_dbg)(void *, int, const char *); int (*f_recv)(void *, unsigned char *, size_t); - int (*f_send)(void *, unsigned char *, size_t); + int (*f_send)(void *, const unsigned char *, size_t); int (*f_vrfy)(void *, x509_cert *, int, int); void *p_rng; /*!< context for the RNG function */ @@ -450,7 +450,7 @@ void ssl_set_dbg( ssl_context *ssl, */ void ssl_set_bio( ssl_context *ssl, int (*f_recv)(void *, unsigned char *, size_t), void *p_recv, - int (*f_send)(void *, unsigned char *, size_t), void *p_send ); + int (*f_send)(void *, const unsigned char *, size_t), void *p_send ); /** * \brief Set the session callbacks (server-side only) diff --git a/library/net.c b/library/net.c index e1d91e4c7..fcfe4d796 100644 --- a/library/net.c +++ b/library/net.c @@ -317,7 +317,7 @@ int net_recv( void *ctx, unsigned char *buf, size_t len ) /* * Write at most 'len' characters */ -int net_send( void *ctx, unsigned char *buf, size_t len ) +int net_send( void *ctx, const unsigned char *buf, size_t len ) { int ret = write( *((int *) ctx), buf, len ); diff --git a/library/ssl_tls.c b/library/ssl_tls.c index 7f82fa0a1..7cb625865 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -1770,7 +1770,7 @@ void ssl_set_dbg( ssl_context *ssl, void ssl_set_bio( ssl_context *ssl, int (*f_recv)(void *, unsigned char *, size_t), void *p_recv, - int (*f_send)(void *, unsigned char *, size_t), void *p_send ) + int (*f_send)(void *, const unsigned char *, size_t), void *p_send ) { ssl->f_recv = f_recv; ssl->f_send = f_send;