Projects
Essentials
rtmpdump
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 9
View file
rtmpdump.changes
Changed
@@ -1,4 +1,11 @@ ------------------------------------------------------------------- +Mon Nov 25 15:15:00 UTC 2013 - joerg.lorenzen@ki.tng.de + +- update to 2.4.git20131007 + * Various bugfixes + * Bump the SO_VERSION to 1 + +------------------------------------------------------------------- Thu Nov 1 16:30:15 UTC 2012 - i@margueirte.su - update to 2.4.git20121102.
View file
rtmpdump.spec
Changed
@@ -4,10 +4,10 @@ # Name: rtmpdump -Version: 2.4.git20121102 +Version: 2.4.git20131007 Release: 0 License: GPL-2.0 -%define soname 0 +%define soname 1 Summary: RTMP Stream Dumper Url: http://rtmpdump.mplayerhq.hu/ Group: Productivity/Networking/Other @@ -81,7 +81,7 @@ flv file, which can be played/transcoded using ffmpeg/mplayer, etc. %prep -%setup -q +%setup -q -n rtmpdump %patch1 %build
View file
rtmpdump-2.4.git20131007.tar.bz2/.gitignore
Added
@@ -0,0 +1,9 @@ +*.[oa] +*.exe +*.so +*.so.[0-9] +*.dylib +rtmpdump +rtmpgw +rtmpsrv +rtmpsuck
View file
rtmpdump-2.4.git20121102.tar.bz2/librtmp/Makefile -> rtmpdump-2.4.git20131007.tar.bz2/librtmp/Makefile
Changed
@@ -22,8 +22,9 @@ DEF_OPENSSL=-DUSE_OPENSSL DEF_GNUTLS=-DUSE_GNUTLS DEF_=-DNO_CRYPTO -REQ_GNUTLS=gnutls +REQ_GNUTLS=gnutls,hogweed,nettle REQ_OPENSSL=libssl,libcrypto +PUB_GNUTLS=-lgmp LIBZ=-lz LIBS_posix= LIBS_darwin= @@ -35,8 +36,9 @@ CRYPTO_LIB=$(LIB_$(CRYPTO)) $(PRIVATE_LIBS) CRYPTO_REQ=$(REQ_$(CRYPTO)) CRYPTO_DEF=$(DEF_$(CRYPTO)) +PUBLIC_LIBS=$(PUB_$(CRYPTO)) -SO_VERSION=0 +SO_VERSION=1 SOX_posix=so SOX_darwin=dylib SOX_mingw=dll @@ -100,6 +102,7 @@ sed -e "s;@prefix@;$(prefix);" -e "s;@libdir@;$(libdir);" \ -e "s;@VERSION@;$(VERSION);" \ -e "s;@CRYPTO_REQ@;$(CRYPTO_REQ);" \ + -e "s;@PUBLIC_LIBS@;$(PUBLIC_LIBS);" \ -e "s;@PRIVATE_LIBS@;$(PRIVATE_LIBS);" librtmp.pc.in > $@ install: install_base $(SO_INST)
View file
rtmpdump-2.4.git20121102.tar.bz2/librtmp/dh.h -> rtmpdump-2.4.git20131007.tar.bz2/librtmp/dh.h
Changed
@@ -79,6 +79,7 @@ #elif defined(USE_GNUTLS) #include <gmp.h> #include <nettle/bignum.h> +#include <gnutls/crypto.h> typedef mpz_ptr MP_t; #define MP_new(m) m = malloc(sizeof(*m)); mpz_init2(m, 1) #define MP_set_w(mpi, w) mpz_set_ui(mpi, w) @@ -104,21 +105,62 @@ #define MDH_new() calloc(1,sizeof(MDH)) #define MDH_free(dh) do {MP_free(((MDH*)(dh))->p); MP_free(((MDH*)(dh))->g); MP_free(((MDH*)(dh))->pub_key); MP_free(((MDH*)(dh))->priv_key); free(dh);} while(0) -extern MP_t gnutls_calc_dh_secret(MP_t *priv, MP_t g, MP_t p); -extern MP_t gnutls_calc_dh_key(MP_t y, MP_t x, MP_t p); +static int MDH_generate_key(MDH *dh) +{ + int num_bytes; + uint32_t seed; + gmp_randstate_t rs; + + num_bytes = (mpz_sizeinbase(dh->p, 2) + 7) / 8 - 1; + if (num_bytes <= 0 || num_bytes > 18000) + return 0; + + dh->priv_key = calloc(1, sizeof(*dh->priv_key)); + if (!dh->priv_key) + return 0; + mpz_init2(dh->priv_key, 1); + gnutls_rnd(GNUTLS_RND_RANDOM, &seed, sizeof(seed)); + gmp_randinit_mt(rs); + gmp_randseed_ui(rs, seed); + mpz_urandomb(dh->priv_key, rs, num_bytes); + gmp_randclear(rs); + + dh->pub_key = calloc(1, sizeof(*dh->pub_key)); + if (!dh->pub_key) + return 0; + mpz_init2(dh->pub_key, 1); + if (!dh->pub_key) { + mpz_clear(dh->priv_key); + free(dh->priv_key); + return 0; + } + + mpz_powm(dh->pub_key, dh->g, dh->priv_key, dh->p); + + return 1; +} -#define MDH_generate_key(dh) (dh->pub_key = gnutls_calc_dh_secret(&dh->priv_key, dh->g, dh->p)) static int MDH_compute_key(uint8_t *secret, size_t len, MP_t pub, MDH *dh) { - MP_t sec = gnutls_calc_dh_key(pub, dh->priv_key, dh->p); - if (sec) - { - MP_setbin(sec, secret, len); - MP_free(sec); - return 0; - } - else + mpz_ptr k; + int num_bytes; + + num_bytes = (mpz_sizeinbase(dh->p, 2) + 7) / 8; + if (num_bytes <= 0 || num_bytes > 18000) + return -1; + + k = calloc(1, sizeof(*k)); + if (!k) return -1; + mpz_init2(k, 1); + + mpz_powm(k, pub, dh->priv_key, dh->p); + nettle_mpz_get_str_256(len, secret, k); + mpz_clear(k); + free(k); + + /* return the length of the shared secret key like DH_compute_key */ + return len; } #else /* USE_OPENSSL */
View file
rtmpdump-2.4.git20121102.tar.bz2/librtmp/librtmp.pc.in -> rtmpdump-2.4.git20131007.tar.bz2/librtmp/librtmp.pc.in
Changed
@@ -8,6 +8,6 @@ Version: @VERSION@ Requires: @CRYPTO_REQ@ URL: http://rtmpdump.mplayerhq.hu -Libs: -L${libdir} -lrtmp -lz +Libs: -L${libdir} -lrtmp -lz @PUBLIC_LIBS@ Libs.private: @PRIVATE_LIBS@ Cflags: -I${incdir}
View file
rtmpdump-2.4.git20121102.tar.bz2/librtmp/rtmp.c -> rtmpdump-2.4.git20131007.tar.bz2/librtmp/rtmp.c
Changed
@@ -2483,7 +2483,7 @@ #define MD5_Update(ctx,data,len) md5_update(ctx,(unsigned char *)data,len) #define MD5_Final(dig,ctx) md5_finish(ctx,dig) #elif defined(USE_GNUTLS) -typedef struct md5_ctx MD5_CTX +typedef struct md5_ctx MD5_CTX; #define MD5_Init(ctx) md5_init(ctx) #define MD5_Update(ctx,data,len) md5_update(ctx,len,data) #define MD5_Final(dig,ctx) md5_digest(ctx,MD5_DIGEST_LENGTH,dig) @@ -2503,6 +2503,16 @@ *ptr = '\0'; } +static char * +AValChr(AVal *av, char c) +{ + int i; + for (i = 0; i < av->av_len; i++) + if (av->av_val[i] == c) + return &av->av_val[i]; + return NULL; +} + static int PublisherAuth(RTMP *r, AVal *description) { @@ -2514,8 +2524,8 @@ #define RESPONSE_LEN 32 #define CHALLENGE2_LEN 16 #define SALTED2_LEN (32+8+8+8) -#define B64DIGEST_LEN 22 /* 16 byte digest => 22 b64 chars */ -#define B64INT_LEN 6 /* 4 byte int => 6 b64 chars */ +#define B64DIGEST_LEN 24 /* 16 byte digest => 22 b64 chars + 2 chars padding */ +#define B64INT_LEN 8 /* 4 byte int => 6 b64 chars + 2 chars padding */ #define HEXHASH_LEN (2*MD5_DIGEST_LENGTH) char response[RESPONSE_LEN]; char challenge2[CHALLENGE2_LEN]; @@ -2598,7 +2608,6 @@ b64enc(md5sum_val, MD5_DIGEST_LENGTH, salted2, SALTED2_LEN); RTMP_Log(RTMP_LOGDEBUG, "%s, b64(md5_1) = %s", __FUNCTION__, salted2); - /* FIXME: what byte order does this depend on? */ challenge2_data = rand(); b64enc((unsigned char *) &challenge2_data, sizeof(int), challenge2, CHALLENGE2_LEN); @@ -2609,7 +2618,7 @@ /* response = base64enc(md5(hash1 + opaque + challenge2)) */ if (opaque.av_len) MD5_Update(&md5ctx, opaque.av_val, opaque.av_len); - if (challenge.av_len) + else if (challenge.av_len) MD5_Update(&md5ctx, challenge.av_val, challenge.av_len); MD5_Update(&md5ctx, challenge2, B64INT_LEN); MD5_Final(md5sum_val, &md5ctx); @@ -2775,7 +2784,7 @@ /* hash2 = hexenc(md5(method + ":/" + app + "/" + appInstance)) */ /* Extract appname + appinstance without query parameters */ apptmp = r->Link.app; - ptr = strchr(apptmp.av_val, '?'); + ptr = AValChr(&apptmp, '?'); if (ptr) apptmp.av_len = ptr - apptmp.av_val; @@ -2783,6 +2792,8 @@ MD5_Update(&md5ctx, method, sizeof(method)-1); MD5_Update(&md5ctx, ":/", 2); MD5_Update(&md5ctx, apptmp.av_val, apptmp.av_len); + if (!AValChr(&apptmp, '/')) + MD5_Update(&md5ctx, "/_definst_", sizeof("/_definst_") - 1); MD5_Final(md5sum_val, &md5ctx); RTMP_Log(RTMP_LOGDEBUG, "%s, md5(%s:/%.*s) =>", __FUNCTION__, method, apptmp.av_len, apptmp.av_val); @@ -3221,7 +3232,7 @@ return TRUE; } - if (prop->p_type == AMF_OBJECT) + if (prop->p_type == AMF_OBJECT || prop->p_type == AMF_ECMA_ARRAY) { if (RTMP_FindFirstMatchingProperty(&prop->p_vu.p_object, name, p)) return TRUE; @@ -3260,47 +3271,44 @@ DumpMetaData(AMFObject *obj) { AMFObjectProperty *prop; - int n; + int n, len; for (n = 0; n < obj->o_num; n++) { + char str[256] = ""; prop = AMF_GetProp(obj, NULL, n); - if (prop->p_type != AMF_OBJECT) - { - char str[256] = ""; - switch (prop->p_type) - { - case AMF_NUMBER: - snprintf(str, 255, "%.2f", prop->p_vu.p_number); - break; - case AMF_BOOLEAN: - snprintf(str, 255, "%s", - prop->p_vu.p_number != 0. ? "TRUE" : "FALSE"); - break; - case AMF_STRING: - snprintf(str, 255, "%.*s", prop->p_vu.p_aval.av_len, - prop->p_vu.p_aval.av_val); - break; - case AMF_DATE: - snprintf(str, 255, "timestamp:%.2f", prop->p_vu.p_number); - break; - default: - snprintf(str, 255, "INVALID TYPE 0x%02x", - (unsigned char)prop->p_type); - } - if (prop->p_name.av_len) - { - /* chomp */ - if (strlen(str) >= 1 && str[strlen(str) - 1] == '\n') - str[strlen(str) - 1] = '\0'; - RTMP_Log(RTMP_LOGINFO, " %-22.*s%s", prop->p_name.av_len, - prop->p_name.av_val, str); - } - } - else + switch (prop->p_type) { + case AMF_OBJECT: + case AMF_ECMA_ARRAY: + case AMF_STRICT_ARRAY: if (prop->p_name.av_len) RTMP_Log(RTMP_LOGINFO, "%.*s:", prop->p_name.av_len, prop->p_name.av_val); DumpMetaData(&prop->p_vu.p_object); + break; + case AMF_NUMBER: + snprintf(str, 255, "%.2f", prop->p_vu.p_number); + break; + case AMF_BOOLEAN: + snprintf(str, 255, "%s", + prop->p_vu.p_number != 0. ? "TRUE" : "FALSE"); + break; + case AMF_STRING: + len = snprintf(str, 255, "%.*s", prop->p_vu.p_aval.av_len, + prop->p_vu.p_aval.av_val); + if (len >= 1 && str[len-1] == '\n') + str[len-1] = '\0'; + break; + case AMF_DATE: + snprintf(str, 255, "timestamp:%.2f", prop->p_vu.p_number); + break; + default: + snprintf(str, 255, "INVALID TYPE 0x%02x", + (unsigned char)prop->p_type); + } + if (str[0] && prop->p_name.av_len) + { + RTMP_Log(RTMP_LOGINFO, " %-22.*s%s", prop->p_name.av_len, + prop->p_name.av_val, str); } } return FALSE;
View file
rtmpdump-2.4.git20121102.tar.bz2/librtmp/rtmp_sys.h -> rtmpdump-2.4.git20131007.tar.bz2/librtmp/rtmp_sys.h
Changed
@@ -68,6 +68,11 @@ #if POLARSSL_VERSION_NUMBER < 0x01010000 #define havege_random havege_rand #endif +#if POLARSSL_VERSION_NUMBER >= 0x01020000 +#define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,ctx) +#else +#define SSL_SET_SESSION(S,resume,timeout,ctx) ssl_set_session(S,resume,timeout,ctx) +#endif typedef struct tls_ctx { havege_state hs; ssl_session ssn; @@ -85,12 +90,12 @@ ssl_set_endpoint(s, SSL_IS_CLIENT); ssl_set_authmode(s, SSL_VERIFY_NONE);\ ssl_set_rng(s, havege_random, &ctx->hs);\ ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ - ssl_set_session(s, 1, 600, &ctx->ssn) + SSL_SET_SESSION(s, 1, 600, &ctx->ssn) #define TLS_server(ctx,s) s = malloc(sizeof(ssl_context)); ssl_init(s);\ ssl_set_endpoint(s, SSL_IS_SERVER); ssl_set_authmode(s, SSL_VERIFY_NONE);\ ssl_set_rng(s, havege_random, ((tls_server_ctx*)ctx)->hs);\ ssl_set_ciphersuites(s, ssl_default_ciphersuites);\ - ssl_set_session(s, 1, 600, &((tls_server_ctx*)ctx)->ssn);\ + SSL_SET_SESSION(s, 1, 600, &((tls_server_ctx*)ctx)->ssn);\ ssl_set_own_cert(s, &((tls_server_ctx*)ctx)->cert, &((tls_server_ctx*)ctx)->key);\ ssl_set_dh_param(s, ((tls_server_ctx*)ctx)->dhm_P, ((tls_server_ctx*)ctx)->dhm_G) #define TLS_setfd(s,fd) ssl_set_bio(s, net_recv, &fd, net_send, &fd)
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.