#endif
#ifdef CONFIG_MBEDTLS
- mbedtls_md5_context tctx;
- mbedtls_md5_starts_ret(&tctx);
- mbedtls_md5_update_ret(&tctx, (const unsigned char *)buf, len);
- mbedtls_md5_finish_ret(&tctx, img_md5);
+ #if MBEDTLS_VERSION_MINOR >= 7
+ mbedtls_md5_context tctx;
+ mbedtls_md5_starts_ret(&tctx);
+ mbedtls_md5_update_ret(&tctx, (const unsigned char *)buf, len);
+ mbedtls_md5_finish_ret(&tctx, img_md5);
+ #else
+ mbedtls_md5_context tctx;
+ mbedtls_md5_starts(&tctx);
+ mbedtls_md5_update(&tctx, (const unsigned char *)buf, len);
+ mbedtls_md5_finish(&tctx, img_md5);
+ #endif
#endif
#ifdef CONFIG_POLARSSL
#endif
#ifdef CONFIG_MBEDTLS
+ #if MBEDTLS_VERSION_MINOR >= 7
mbedtls_md5_context tctx;
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 *)uri, strlen(uri));
mbedtls_md5_finish_ret(&tctx, digest_mu);
+ #else
+ 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);
+ #endif
#endif
#ifdef CONFIG_POLARSSL
#endif
#ifdef CONFIG_MBEDTLS
+ #if MBEDTLS_VERSION_MINOR >= 7
mbedtls_md5_starts_ret(&tctx);
mbedtls_md5_update_ret(&tctx, buf, 32);
mbedtls_md5_update_ret(&tctx, (unsigned char *)":", 1);
snprintf((char *)buf + 2 * i, 3, "%02x", digest_mu[i]);
mbedtls_md5_update_ret(&tctx, buf, 32);
mbedtls_md5_finish_ret(&tctx, digest_total);
+ #else
+ 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);
+ 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);
+ #endif
#endif
#ifdef CONFIG_POLARSSL
#endif
#ifdef CONFIG_MBEDTLS
- mbedtls_md5_context tctx;
- 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);
+ #if MBEDTLS_VERSION_MINOR >= 7
+ mbedtls_md5_context tctx;
+ 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);
+ #else
+ 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);
+ #endif
#endif
#ifdef CONFIG_POLARSSL