[rtmpdump] r141 - in trunk: ChangeLog Makefile hashswf.c rtmp.h rtmpdump.c rtmpsuck.c streams.c swfvfy.c

hyc subversion at mplayerhq.hu
Wed Dec 30 05:30:47 CET 2009


Author: hyc
Date: Wed Dec 30 05:30:45 2009
New Revision: 141

Log:
Rename SWFVerify() to RTMP_HashSWF(), rename swfvfy.c to hashswf.c

Added:
   trunk/hashswf.c
      - copied, changed from r133, trunk/swfvfy.c
Deleted:
   trunk/swfvfy.c
Modified:
   trunk/ChangeLog
   trunk/Makefile
   trunk/rtmp.h
   trunk/rtmpdump.c
   trunk/rtmpsuck.c
   trunk/streams.c

Modified: trunk/ChangeLog
==============================================================================
--- trunk/ChangeLog	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/ChangeLog	Wed Dec 30 05:30:45 2009	(r141)
@@ -3,7 +3,18 @@ Copyright 2008-2009 Andrej Stepanchuk; D
 Copyright 2009 Howard Chu
 Copyright 2009 The Flvstreamer Team
 
-16 December 2009, v2.x
+29 December 2009, v2.x
+- AMF cleanup: bounds checking for all encoders, moved AMF_EncodeNamed* from rtmp.c
+- added SecureToken support
+- added automatic SWF hash calculation
+- added server-side handshake processing
+- added rtmpsrv stub server example
+- added rtmpsuck proxy server
+- tweaks for logging
+- renamed more functions to cleanup namespace for library use
+- tweaks for server operation: objectEncoding, chunksize changes
+
+16 December 2009, v2.0
 - rewrote everything else in C, reorganized to make it usable again as a library
 - fixed more portability bugs
 - plugged memory leaks
@@ -85,7 +96,7 @@ content to your player over http
 11 Mar 2009, v1.4
 
 - fixed resume bug: when the server switches between audio/video packets and FLV
-chunk packets (why should a server want to do that? some actually do!) and rtmpdump 
+chunk packets (why should a server want to do that? some actually do!) and rtmpdump
 was invoked with --resume the keyframe check prevented rtmpdump from continuing
 
 - fixed endianness

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/Makefile	Wed Dec 30 05:30:45 2009	(r141)
@@ -37,23 +37,23 @@ arm:
 clean:
 	rm -f *.o rtmpdump$(EXT) streams$(EXT)
 
-streams: log.o rtmp.o amf.o streams.o parseurl.o swfvfy.o
+streams: log.o rtmp.o amf.o streams.o parseurl.o hashswf.o
 	$(CC) $(LDFLAGS) $^ -o $@$(EXT) $(SLIBS)
 
-rtmpdump: log.o rtmp.o amf.o rtmpdump.o parseurl.o swfvfy.o
+rtmpdump: log.o rtmp.o amf.o rtmpdump.o parseurl.o hashswf.o
 	$(CC) $(LDFLAGS) $^ -o $@$(EXT) $(LIBS)
 
 rtmpsrv: log.o rtmp.o amf.o rtmpsrv.o
 	$(CC) $(LDFLAGS) $^ -o $@$(EXT) $(SLIBS)
 
-rtmpsuck: log.o rtmp.o amf.o rtmpsuck.o swfvfy.o
+rtmpsuck: log.o rtmp.o amf.o rtmpsuck.o hashswf.o
 	$(CC) $(LDFLAGS) $^ -o $@$(EXT) $(SLIBS)
 
 log.o: log.c log.h Makefile
 parseurl.o: parseurl.c parseurl.h log.h Makefile
-streams.o: streams.c rtmp.h log.h swfvfy.o Makefile
+streams.o: streams.c rtmp.h log.h hashswf.o Makefile
 rtmp.o: rtmp.c rtmp.h handshake.h dh.h log.h amf.h Makefile
 amf.o: amf.c amf.h bytes.h log.h Makefile
 rtmpdump.o: rtmpdump.c rtmp.h log.h amf.h Makefile
 rtmpsrv.o: rtmpsrv.c rtmp.h log.h amf.h Makefile
-swfvfy.o: swfvfy.c
+hashswf.o: hashswf.c

Copied and modified: trunk/hashswf.c (from r133, trunk/swfvfy.c)
==============================================================================
--- trunk/swfvfy.c	Tue Dec 29 23:47:18 2009	(r133, copy source)
+++ trunk/hashswf.c	Wed Dec 30 05:30:45 2009	(r141)
@@ -31,6 +31,8 @@
 #include <arpa/inet.h>
 #endif
 
+#include "rtmp.h"
+
 #include <openssl/sha.h>
 #include <openssl/hmac.h>
 #include <zlib.h>
@@ -219,7 +221,7 @@ leave:
 #define HEX2BIN(a)      (((a)&0x40)?((a)&0xf)+9:((a)&0xf))
 
 int
-SWFVerify(const char *url, unsigned int *size, unsigned char *hash, int ask)
+RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int ask)
 {
   FILE *f = NULL;
   char *path, *home, date[64];

Modified: trunk/rtmp.h
==============================================================================
--- trunk/rtmp.h	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/rtmp.h	Wed Dec 30 05:30:45 2009	(r141)
@@ -207,5 +207,11 @@ bool RTMP_SendPause(RTMP *r, bool DoPaus
 bool RTMP_FindFirstMatchingProperty(AMFObject *obj, const AVal *name,
 				      AMFObjectProperty *p);
 
+#ifdef CRYPTO
+/* hashswf.c */
+#define HASHLEN	32
+
+int RTMP_HashSWF(const char *url, unsigned int *size, unsigned char *hash, int ask);
+#endif
 
 #endif

Modified: trunk/rtmpdump.c
==============================================================================
--- trunk/rtmpdump.c	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/rtmpdump.c	Wed Dec 30 05:30:45 2009	(r141)
@@ -45,11 +45,6 @@
 #include "log.h"
 #include "parseurl.h"
 
-#ifdef CRYPTO
-#define HASHLEN	32
-extern int SWFVerify(const char *url, unsigned int *size, unsigned char *hash, int ask);
-#endif
-
 #define RTMPDUMP_VERSION	"v2.0"
 
 #define RD_SUCCESS		0
@@ -1289,7 +1284,7 @@ main(int argc, char **argv)
 	  }
         case 'W':
 	  STR2AVAL(swfUrl, optarg);
-          if (SWFVerify(optarg, &swfSize, hash, 1) == 0)
+          if (RTMP_HashSWF(optarg, &swfSize, hash, 1) == 0)
             {
               swfHash.av_val = (char *)hash;
               swfHash.av_len = HASHLEN;

Modified: trunk/rtmpsuck.c
==============================================================================
--- trunk/rtmpsuck.c	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/rtmpsuck.c	Wed Dec 30 05:30:45 2009	(r141)
@@ -45,11 +45,6 @@
 #include <pthread.h>
 #endif
 
-#ifdef CRYPTO
-#define HASHLEN	32
-extern int SWFVerify(const char *url, unsigned int *size, unsigned char *hash, int ask);
-#endif
-
 #define RTMPDUMP_PROXY_VERSION	"v2.0"
 
 #define RD_SUCCESS		0
@@ -212,7 +207,7 @@ ServeInvoke(STREAMING_SERVER *server, RT
             {
               unsigned char hash[HASHLEN];
               server->rc.Link.swfUrl = pval;
-              if (SWFVerify(pval.av_val, &server->rc.Link.SWFSize, hash, 0) == 0)
+              if (RTMP_HashSWF(pval.av_val, &server->rc.Link.SWFSize, hash, 0) == 0)
                 {
                   server->rc.Link.SWFHash.av_val = malloc(HASHLEN);
                   memcpy(server->rc.Link.SWFHash.av_val, hash, HASHLEN);

Modified: trunk/streams.c
==============================================================================
--- trunk/streams.c	Wed Dec 30 03:30:50 2009	(r140)
+++ trunk/streams.c	Wed Dec 30 05:30:45 2009	(r141)
@@ -37,11 +37,6 @@
 #include <pthread.h>
 #endif
 
-#ifdef CRYPTO
-#define HASHLEN	32
-extern int SWFVerify(const char *url, unsigned int *size, unsigned char *hash, int ask);
-#endif
-
 #define RTMPDUMP_STREAMS_VERSION	"v2.0"
 
 #define RD_SUCCESS		0
@@ -947,7 +942,7 @@ ParseOption(char opt, char *arg, RTMP_RE
         unsigned char hash[HASHLEN];
 
         STR2AVAL(req->swfUrl, arg);
-        if (SWFVerify(arg, &req->swfSize, hash, 1) == 0)
+        if (RTMP_HashSWF(arg, &req->swfSize, hash, 1) == 0)
           {
             req->swfHash.av_val = malloc(HASHLEN);
             req->swfHash.av_len = HASHLEN;


More information about the rtmpdump mailing list