From 628f72259f20a80df97fc1e8240deab2abb9e2ca Mon Sep 17 00:00:00 2001 From: hyc Date: Wed, 7 Apr 2010 07:24:55 +0000 Subject: [PATCH] Drop #ifdef CRYPTO from rtmp.h; apps have no way to know any more if CRYPTO is defined or not git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@420 400ebc74-4327-4243-bc38-086b20814532 --- librtmp/rtmp.h | 11 +++-------- rtmpdump.c | 10 +++++----- rtmpgw.c | 10 +++++----- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/librtmp/rtmp.h b/librtmp/rtmp.h index 62f9d10..ff68dd6 100644 --- a/librtmp/rtmp.h +++ b/librtmp/rtmp.h @@ -146,15 +146,14 @@ extern "C" unsigned short socksport; unsigned short port; -#ifdef CRYPTO +#define RTMP_SWF_HASHLEN 32 void *dh; // for encryption void *rc4keyIn; void *rc4keyOut; uint32_t SWFSize; - char SWFHash[32]; - char SWFVerificationResponse[42]; -#endif + char SWFHash[RTMP_SWF_HASHLEN]; + char SWFVerificationResponse[RTMP_SWF_HASHLEN+10]; } RTMP_LNK; /* state for read() wrapper */ @@ -304,13 +303,9 @@ extern "C" int RTMP_Read(RTMP *r, char *buf, int size); int RTMP_Write(RTMP *r, char *buf, int size); -#ifdef CRYPTO /* hashswf.c */ -#define HASHLEN 32 - int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int age); -#endif #ifdef __cplusplus }; diff --git a/rtmpdump.c b/rtmpdump.c index ead20df..a659afc 100644 --- a/rtmpdump.c +++ b/rtmpdump.c @@ -757,7 +757,7 @@ main(int argc, char **argv) #ifdef CRYPTO int swfAge = 30; /* 30 days for SWF cache by default */ int swfVfy = 0; - unsigned char hash[HASHLEN]; + unsigned char hash[RTMP_SWF_HASHLEN]; #endif char *flvFile = 0; @@ -848,13 +848,13 @@ main(int argc, char **argv) case 'w': { int res = hex2bin(optarg, &swfHash.av_val); - if (res != HASHLEN) + if (res != RTMP_SWF_HASHLEN) { swfHash.av_val = NULL; RTMP_Log(RTMP_LOGWARNING, - "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN); + "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN); } - swfHash.av_len = HASHLEN; + swfHash.av_len = RTMP_SWF_HASHLEN; break; } case 'x': @@ -1109,7 +1109,7 @@ main(int argc, char **argv) if (RTMP_HashSWF(swfUrl.av_val, &swfSize, hash, swfAge) == 0) { swfHash.av_val = (char *)hash; - swfHash.av_len = HASHLEN; + swfHash.av_len = RTMP_SWF_HASHLEN; } } diff --git a/rtmpgw.c b/rtmpgw.c index 11a8477..f23e72c 100644 --- a/rtmpgw.c +++ b/rtmpgw.c @@ -105,7 +105,7 @@ typedef struct uint32_t dStopOffset; #ifdef CRYPTO - unsigned char hash[HASHLEN]; + unsigned char hash[RTMP_SWF_HASHLEN]; #endif } RTMP_REQUEST; @@ -520,7 +520,7 @@ void processTCPrequest(STREAMING_SERVER * server, // server socket and state (ou if (RTMP_HashSWF(req.swfUrl.av_val, &req.swfSize, req.hash, req.swfAge) == 0) { req.swfHash.av_val = (char *)req.hash; - req.swfHash.av_len = HASHLEN; + req.swfHash.av_len = RTMP_SWF_HASHLEN; } #endif } @@ -786,13 +786,13 @@ ParseOption(char opt, char *arg, RTMP_REQUEST * req) case 'w': { int res = hex2bin(arg, &req->swfHash.av_val); - if (!res || res != HASHLEN) + if (!res || res != RTMP_SWF_HASHLEN) { req->swfHash.av_val = NULL; RTMP_Log(RTMP_LOGWARNING, - "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", HASHLEN); + "Couldn't parse swf hash hex string, not hexstring or not %d bytes, ignoring!", RTMP_SWF_HASHLEN); } - req->swfHash.av_len = HASHLEN; + req->swfHash.av_len = RTMP_SWF_HASHLEN; break; } case 'x': -- 2.50.1