]> granicus.if.org Git - rtmpdump/commitdiff
Drop #ifdef CRYPTO from rtmp.h; apps have no way to know any more if CRYPTO
authorhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Wed, 7 Apr 2010 07:24:55 +0000 (07:24 +0000)
committerhyc <hyc@400ebc74-4327-4243-bc38-086b20814532>
Wed, 7 Apr 2010 07:24:55 +0000 (07:24 +0000)
is defined or not

git-svn-id: svn://svn.mplayerhq.hu/rtmpdump/trunk@420 400ebc74-4327-4243-bc38-086b20814532

librtmp/rtmp.h
rtmpdump.c
rtmpgw.c

index 62f9d108af965090eee1fa4e3aaa7212f109c03d..ff68dd6d3b7a99197ed32195d05a4c751cbf79f3 100644 (file)
@@ -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
 };
index ead20df66ff4c4e71a0daa355b516bd0ea47d79b..a659afc1c86cf462283e63a128b2960fd0eb796c 100644 (file)
@@ -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;
         }
     }
 
index 11a84778b61f2299ba725f7abe0dc209a415a157..f23e72c15cbbc6ecb8981f6d790e827a8c9128a2 100644 (file)
--- 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':