Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 67ef3179 authored by Andreas Huber's avatar Andreas Huber Committed by Android (Google) Code Review
Browse files

Merge "We don't have access to the md5 implementation on the simulator, let's...

Merge "We don't have access to the md5 implementation on the simulator, let's disable digest authentication in rtsp for simulator targets."
parents de0f98ea cf74754f
Loading
Loading
Loading
Loading
+10 −0
Original line number Original line Diff line number Diff line
@@ -761,6 +761,12 @@ bool ARTSPConnection::parseAuthMethod(const sp<ARTSPResponse> &response) {
    if (!strncmp(value.c_str(), "Basic", 5)) {
    if (!strncmp(value.c_str(), "Basic", 5)) {
        mAuthType = BASIC;
        mAuthType = BASIC;
    } else {
    } else {
#if !defined(HAVE_ANDROID_OS)
        // We don't have access to the MD5 implementation on the simulator,
        // so we won't support digest authentication.
        return false;
#endif

        CHECK(!strncmp(value.c_str(), "Digest", 6));
        CHECK(!strncmp(value.c_str(), "Digest", 6));
        mAuthType = DIGEST;
        mAuthType = DIGEST;


@@ -776,6 +782,7 @@ bool ARTSPConnection::parseAuthMethod(const sp<ARTSPResponse> &response) {
    return true;
    return true;
}
}


#if defined(HAVE_ANDROID_OS)
static void H(const AString &s, AString *out) {
static void H(const AString &s, AString *out) {
    out->clear();
    out->clear();


@@ -804,6 +811,7 @@ static void H(const AString &s, AString *out) {
        out->append(&nibble, 1);
        out->append(&nibble, 1);
    }
    }
}
}
#endif


static void GetMethodAndURL(
static void GetMethodAndURL(
        const AString &request, AString *method, AString *url) {
        const AString &request, AString *method, AString *url) {
@@ -845,6 +853,7 @@ void ARTSPConnection::addAuthentication(AString *request) {
        return;
        return;
    }
    }


#if defined(HAVE_ANDROID_OS)
    CHECK_EQ((int)mAuthType, (int)DIGEST);
    CHECK_EQ((int)mAuthType, (int)DIGEST);


    AString method, url;
    AString method, url;
@@ -893,6 +902,7 @@ void ARTSPConnection::addAuthentication(AString *request) {
    fragment.append("\r\n");
    fragment.append("\r\n");


    request->insert(fragment, i + 2);
    request->insert(fragment, i + 2);
#endif
}
}


}  // namespace android
}  // namespace android