From: Mike Brady Date: Sat, 2 Feb 2019 13:05:49 +0000 (+0000) Subject: Fix warnings about deprecated mbedtls API calls X-Git-Tag: 3.3RC0~66^2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf03983694e87c764a6346dc5119fe6e080e6996;p=thirdparty%2Fshairport-sync.git Fix warnings about deprecated mbedtls API calls --- diff --git a/metadata_hub.c b/metadata_hub.c index f6c92ae8..015327f0 100644 --- a/metadata_hub.c +++ b/metadata_hub.c @@ -228,9 +228,9 @@ char *metadata_write_image_file(const char *buf, int len) { #ifdef CONFIG_MBEDTLS mbedtls_md5_context tctx; - mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, (const unsigned char *)buf, len); - mbedtls_md5_finish(&tctx, img_md5); + mbedtls_md5_starts_ret(&tctx); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)buf, len); + mbedtls_md5_finish_ret(&tctx, img_md5); #endif #ifdef CONFIG_POLARSSL diff --git a/player.c b/player.c index c0b4b54f..e94e249b 100644 --- a/player.c +++ b/player.c @@ -2622,7 +2622,7 @@ void player_volume_without_notification(double airplay_volume, rtsp_conn_info *c } } else { - int32_t max_db, min_db; + int32_t max_db =0, min_db = 0; switch (volume_mode) { case vol_hw_only: max_db = hw_max_db; diff --git a/rtsp.c b/rtsp.c index 67e2a88a..3143dba5 100644 --- a/rtsp.c +++ b/rtsp.c @@ -2039,18 +2039,18 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) { #ifdef CONFIG_MBEDTLS mbedtls_md5_context tctx; - mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, (const unsigned char *)username, strlen(username)); - mbedtls_md5_update(&tctx, (unsigned char *)":", 1); - mbedtls_md5_update(&tctx, (const unsigned char *)realm, strlen(realm)); - mbedtls_md5_update(&tctx, (unsigned char *)":", 1); - mbedtls_md5_update(&tctx, (const unsigned char *)config.password, strlen(config.password)); - mbedtls_md5_finish(&tctx, digest_urp); - mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, (const unsigned char *)req->method, strlen(req->method)); - mbedtls_md5_update(&tctx, (unsigned char *)":", 1); - mbedtls_md5_update(&tctx, (const unsigned char *)uri, strlen(uri)); - mbedtls_md5_finish(&tctx, digest_mu); + mbedtls_md5_starts_ret(&tctx); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)username, strlen(username)); + mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)realm, strlen(realm)); + mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)config.password, strlen(config.password)); + mbedtls_md5_finish_ret(&tctx, digest_urp); + mbedtls_md5_starts_ret(&tctx); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)req->method, strlen(req->method)); + mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)uri, strlen(uri)); + mbedtls_md5_finish_ret(&tctx, digest_mu); #endif #ifdef CONFIG_POLARSSL @@ -2089,15 +2089,15 @@ static int rtsp_auth(char **nonce, rtsp_message *req, rtsp_message *resp) { #endif #ifdef CONFIG_MBEDTLS - mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, buf, 32); - mbedtls_md5_update(&tctx, (unsigned char *)":", 1); - mbedtls_md5_update(&tctx, (const unsigned char *)*nonce, strlen(*nonce)); - mbedtls_md5_update(&tctx, (unsigned char *)":", 1); + mbedtls_md5_starts_ret(&tctx); + mbedtls_md5_update_ret(&tctx, buf, 32); + mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1); + mbedtls_md5_update_ret(&tctx, (const unsigned char *)*nonce, strlen(*nonce)); + mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1); for (i = 0; i < 16; i++) snprintf((char *)buf + 2 * i, 3, "%02x", digest_mu[i]); - mbedtls_md5_update(&tctx, buf, 32); - mbedtls_md5_finish(&tctx, digest_total); + mbedtls_md5_update_ret(&tctx, buf, 32); + mbedtls_md5_finish_ret(&tctx, digest_total); #endif #ifdef CONFIG_POLARSSL diff --git a/shairport.c b/shairport.c index 15f8b9c8..9a26a368 100644 --- a/shairport.c +++ b/shairport.c @@ -1610,9 +1610,9 @@ int main(int argc, char **argv) { #ifdef CONFIG_MBEDTLS mbedtls_md5_context tctx; - mbedtls_md5_starts(&tctx); - mbedtls_md5_update(&tctx, (unsigned char *)config.service_name, strlen(config.service_name)); - mbedtls_md5_finish(&tctx, ap_md5); + mbedtls_md5_starts_ret(&tctx); + mbedtls_md5_update_ret(&tctx, (unsigned char *)config.service_name, strlen(config.service_name)); + mbedtls_md5_finish_ret(&tctx, ap_md5); #endif #ifdef CONFIG_POLARSSL