From 4579b7d49f6dd4f37e6043e59debfd72d69b8e7b Mon Sep 17 00:00:00 2001 From: Andreas Huber Date: Wed, 20 Oct 2010 15:00:34 -0700 Subject: Support for BASIC and DIGEST authentication schemes in RTSP. Support for malformed packet descriptions that end lines in LF only, instead of CRLF. Change-Id: I57eaefdc4b300a8f56bbe5cf3a34c424e8efe63a related-to-bug: 3084183 --- media/libstagefright/rtsp/ARTSPConnection.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) (limited to 'media/libstagefright/rtsp/ARTSPConnection.h') diff --git a/media/libstagefright/rtsp/ARTSPConnection.h b/media/libstagefright/rtsp/ARTSPConnection.h index 96e0d5b..19be2a6 100644 --- a/media/libstagefright/rtsp/ARTSPConnection.h +++ b/media/libstagefright/rtsp/ARTSPConnection.h @@ -42,6 +42,10 @@ struct ARTSPConnection : public AHandler { void observeBinaryData(const sp &reply); + static bool ParseURL( + const char *url, AString *host, unsigned *port, AString *path, + AString *user, AString *pass); + protected: virtual ~ARTSPConnection(); virtual void onMessageReceived(const sp &msg); @@ -62,9 +66,18 @@ private: kWhatObserveBinaryData = 'obin', }; + enum AuthType { + NONE, + BASIC, + DIGEST + }; + static const int64_t kSelectTimeoutUs; State mState; + AString mUser, mPass; + AuthType mAuthType; + AString mNonce; int mSocket; int32_t mConnectionID; int32_t mNextCSeq; @@ -90,8 +103,11 @@ private: sp receiveBinaryData(); bool notifyResponseListener(const sp &response); - static bool ParseURL( - const char *url, AString *host, unsigned *port, AString *path); + bool parseAuthMethod(const sp &response); + void addAuthentication(AString *request); + + status_t findPendingRequest( + const sp &response, ssize_t *index) const; static bool ParseSingleUnsignedLong( const char *from, unsigned long *x); -- cgit v1.1