Commit 977f314a authored by Reinhard Tartler's avatar Reinhard Tartler

Really revert to version 79459a2b

parent 8cd51203
.pc
*~
*.o
*.a
debian/*.log
debian/*.substvars
debian/files
debian/librtmp-dev
debian/rtmpdump
debian/tmp
librtmp/librtmp.pc
*.[oa]
*.exe
*.so
*.so.[0-9]
*.dylib
rtmpdump
rtmpgw
rtmpsrv
......
......@@ -12,7 +12,7 @@ CRYPTO=OPENSSL
#CRYPTO=POLARSSL
#CRYPTO=GNUTLS
LIBZ=-lz
LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ)
LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ)
LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
LIB_POLARSSL=-lpolarssl $(LIBZ)
CRYPTO_LIB=$(LIB_$(CRYPTO))
......
rtmpdump (2.4+20111222.git4e06e21-1) unstable; urgency=low
* Imported Upstream version 2.4+20111222.git4e06e21
* revise package descriptions (Closes: #638664)
-- Reinhard Tartler <siretart@tauware.de> Sun, 08 Jan 2012 12:27:09 +0100
rtmpdump (2.4~20110711.gitc28f1bab-1) unstable; urgency=low
* Team upload.
[ Fabian Greffrath ]
* Fix previous changelog entry.
* Fix debian/watch to scan for .tgz as well as .tar.gz file extensions.
* Remove myself from Uploaders.
[ Andres Mejia ]
* Build depend on libgnutls-dev >= 2.4.1.
[ Alessio Treglia ]
* New upstream release (Closes: #637867):
- Add RTMPE type 9 handshake support.
* Switch packaging to source format 3.0 (quilt).
* Enable multiarch (Closes: #637861).
Thanks to Steve Langasek for the patch!
* Refresh 01_unbreak_makefile.diff
* Drop patches applied upstream:
- 02_strtime-visibility.patch
- 03-Dont-link-explicitly-against-static-library.patch
* debian/control:
- Correct team's name in the Maintainer field.
- Correct small error in the description, URL should be
capitalized (Closes: #616461).
- Description should not start with an article.
* Update debian/copyright.
* Add gbp config file.
* Add simple script to prepare release tarballs from upstream's git.
* Bump Standards.
-- Alessio Treglia <alessio@debian.org> Wed, 17 Aug 2011 12:16:03 +0200
rtmpdump (2.3-2) unstable; urgency=low
[ Reinhard Tartler ]
* make librtmp-dev depend on librtmp0
[ Andres Mejia ]
* Move ${misc:Depends} as last entry in Depends field of librtmp-dev.
[ Fabian Greffrath ]
* debian/patches/03-Dont-link-explicitly-against-static-library.patch:
New patch from upstream SVN (slightly modified) to avoid explicit
linking against the static library.
-- Reinhard Tartler <siretart@tauware.de> Sun, 01 Aug 2010 08:59:47 -0400
rtmpdump (2.3-1) unstable; urgency=low
* New upstream release:
+ debian/patches/02_fix_gnutls_teardown.diff:
- Dropped, merged upstream.
+ debian/librtmp0.install,
debian/librtmp0.symbols,
debian/control,
debian/librtmp-dev.install,
debian/rules:
- Add shared library package.
+ debian/patches/01_unbreak_makefile.diff:
- Refreshed and fixed the clean rule too.
+ debian/patches/02_strtime-visibility.patch:
- Hide the private strtime symbol by making it static
to prevent any symbol conflicts.
-- Sebastian Dröge <slomo@debian.org> Mon, 05 Jul 2010 19:57:14 +0200
rtmpdump (2.2e-4) unstable; urgency=low
[ Fabian Greffrath ]
* Add myself to Uploaders.
* Add Vcs-* fields to debian/control.
* Fix typo in librtmp-dev package description.
* Fix debhelper 7 usage as per dh(1) manpage.
[ Reinhard Tartler ]
* librtmp is built against gnutls, so depend on libgnutls headers
* Bump standards version, no changes needed
-- Reinhard Tartler <siretart@tauware.de> Tue, 29 Jun 2010 13:44:16 +0200
rtmpdump (2.2e-3) unstable; urgency=low
* Build with -fPIC to allow linking of the library into shared libraries,
e.g. ffmpeg (Closes: #585000).
* Use new Free Software Foundation address in debian/copyright.
-- Sebastian Dröge <slomo@debian.org> Thu, 17 Jun 2010 11:24:05 +0200
rtmpdump (2.2e-2) unstable; urgency=low
* update debian/copyright after consulting upstream
-- Reinhard Tartler <siretart@tauware.de> Thu, 03 Jun 2010 20:53:02 +0200
rtmpdump (2.2e-1) unstable; urgency=low
* New upstream release.
-- Reinhard Tartler <siretart@tauware.de> Sun, 30 May 2010 21:41:50 +0200
rtmpdump (2.2d-1) unstable; urgency=low
* Initial release (Closes: #529974)
-- Reinhard Tartler <siretart@tauware.de> Sun, 30 May 2010 17:07:16 +0200
librtmp/librtmp.pc
Source: rtmpdump
Priority: extra
Maintainer: Debian Multimedia Maintainers <pkg-multimedia-maintainers@lists.alioth.debian.org>
Uploaders:
Reinhard Tartler <siretart@tauware.de>,
Sebastian Dröge <slomo@debian.org>
Build-Depends:
debhelper (>= 8.1.3),
libgnutls-dev (>= 2.4.1)
Standards-Version: 3.9.2
Section: web
Vcs-Git: git://git.debian.org/git/pkg-multimedia/rtmpdump.git
Vcs-Browser: http://git.debian.org/?p=pkg-multimedia/rtmpdump.git;a=summary
Homepage: http://rtmpdump.mplayerhq.hu/
Package: rtmpdump
Architecture: any
Depends: ${misc:Depends}, ${shlibs:Depends}
Suggests: ffmpeg, mplayer
Description: small dumper for media content streamed over the RTMP protocol
A small dumper for media content streamed over the RTMP protocol (like BBC's
iPlayer high quality streams). Supplying an RTMP URL will result in a dumped
flv file, which can be played/transcoded with standard tools.
Package: librtmp0
Section: libs
Depends: ${misc:Depends}, ${shlibs:Depends}
Pre-Depends: ${misc:Pre-Depends}
Architecture: any
Multi-Arch: same
Description: toolkit for RTMP streams (shared library)
A small dumper for media content streamed over the RTMP protocol (like BBC's
iPlayer high quality streams). Supplying an RTMP URL will result in a dumped
flv file, which can be played/transcoded with standard tools.
.
This package contains the shared libraries, header files needed by
programs that want to use librtmp.
Package: librtmp-dev
Section: libdevel
Depends: libgnutls-dev, librtmp0 (= ${binary:Version}), ${misc:Depends}
Architecture: any
Description: toolkit for RTMP streams (development files)
A small dumper for media content streamed over the RTMP protocol (like BBC's
iPlayer high quality streams). Supplying an RTMP URL will result in a dumped
flv file, which can be played/transcoded with standard tools.
.
This package contains the development libraries, header files needed by
programs that want to compile with librtmp.
This work was packaged for Debian by:
Reinhard Tartler <siretart@tauware.de> on Sun, 30 May 2010 17:07:16 +0200
It was downloaded from http://rtmpdump.mplayerhq.hu/
Upstream Authors and Copyright:
RTMP Dump
(C) 2009 Andrej Stepanchuk
(C) 2009-2011 Howard Chu
(C) 2010 2a665470ced7adb7156fcef47f8199a6371c117b8a79e399a2771e0b36384090
License of the programs in the rtmpdump package:
rtmpdump - small dumper for media content streamed over the RTMP protocol
Copyright (C) 2009 Andrej Stepanchuk
Copyright (C) 2009-2010 Howard Chu
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
License of the librtmp library (included in the librtmp-dev package and in the
librmtp/ subdirectory in the source tree):
Copyright (C) 2005-2008 Team XBMC
http://www.xbmc.org
Copyright (C) 2008-2009 Andrej Stepanchuk
Copyright (C) 2009-2010 Howard Chu
librtmp is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation; either version 2.1,
or (at your option) any later version.
librtmp is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with librtmp see the file COPYING. If not, write to
the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,
MA 02110-1301, USA.
http://www.gnu.org/copyleft/lgpl.html
The Debian packaging is:
Copyright (C) 2010 Reinhard Tartler <siretart@tauware.de>
and is licensed under the GNU Lesser General Public License.
On Debian GNU/Linux systems, the complete text of the GNU General Public
License can be found in `/usr/share/common-licenses/GPL-2' and the text of the
GNU Lesser General Public License is in `/usr/share/common-licenses/LGPL-2.1'.
[DEFAULT]
pristine-tar = True
#!/bin/sh
set -e
BASE_REL=$(dpkg-parsechangelog 2>/dev/null | sed -ne 's/Version: \([0-9.]\+\)+\?.*/\1/p')
UPSTREAM_GIT="git://git.ffmpeg.org/rtmpdump"
if [ -z ${BASE_REL} ]; then
echo 'Please run this script from the sources root directory.'
exit 1
fi
echo "Fetching latest upstream code into FETCH_HEAD"
git fetch $UPSTREAM_GIT
RTMPDUMP_GIT_COMMIT=`git describe --always FETCH_HEAD`
RTMPDUMP_GIT_DATE=`git --no-pager log -1 --pretty=format:%cd --date=short FETCH_HEAD | sed s/-//g`
TARBALL="../rtmpdump_${BASE_REL}+${RTMPDUMP_GIT_DATE}.git${RTMPDUMP_GIT_COMMIT}.orig.tar.gz"
git archive --format=tar --prefix=rtmpdump-"${RTMPDUMP_GIT_DATE}/" HEAD | \
gzip -9fn > "$TARBALL"
echo "Suchessfully created $TARBALL"
usr/include/*
usr/lib/*/lib*.a
usr/lib/*/lib*.so
usr/lib/*/pkgconfig/*
librtmp.so.0 librtmp0 #MINVER#
* Build-Depends-Package: librtmp-dev
AMF3CD_AddProp@Base 2.3
AMF3CD_GetProp@Base 2.3
AMF3Prop_Decode@Base 2.3
AMF3ReadInteger@Base 2.3
AMF3ReadString@Base 2.3
AMF3_Decode@Base 2.3
AMFProp_Decode@Base 2.3
AMFProp_Dump@Base 2.3
AMFProp_Encode@Base 2.3
AMFProp_GetBoolean@Base 2.3
AMFProp_GetName@Base 2.3
AMFProp_GetNumber@Base 2.3
AMFProp_GetObject@Base 2.3
AMFProp_GetString@Base 2.3
AMFProp_GetType@Base 2.3
AMFProp_IsValid@Base 2.3
AMFProp_Reset@Base 2.3
AMFProp_SetName@Base 2.3
AMF_AddProp@Base 2.3
AMF_CountProp@Base 2.3
AMF_Decode@Base 2.3
AMF_DecodeArray@Base 2.3
AMF_DecodeBoolean@Base 2.3
AMF_DecodeInt16@Base 2.3
AMF_DecodeInt24@Base 2.3
AMF_DecodeInt32@Base 2.3
AMF_DecodeLongString@Base 2.3
AMF_DecodeNumber@Base 2.3
AMF_DecodeString@Base 2.3
AMF_Dump@Base 2.3
AMF_Encode@Base 2.3
AMF_EncodeBoolean@Base 2.3
AMF_EncodeInt16@Base 2.3
AMF_EncodeInt24@Base 2.3
AMF_EncodeInt32@Base 2.3
AMF_EncodeNamedBoolean@Base 2.3
AMF_EncodeNamedNumber@Base 2.3
AMF_EncodeNamedString@Base 2.3
AMF_EncodeNumber@Base 2.3
AMF_EncodeString@Base 2.3
AMF_GetProp@Base 2.3
AMF_Reset@Base 2.3
HTTP_get@Base 2.3
RTMPPacket_Alloc@Base 2.3
RTMPPacket_Dump@Base 2.3
RTMPPacket_Free@Base 2.3
RTMPPacket_Reset@Base 2.3
RTMPProtocolStrings@Base 2.3
RTMPProtocolStringsLower@Base 2.3
RTMPSockBuf_Close@Base 2.3
RTMPSockBuf_Fill@Base 2.3
RTMPSockBuf_Send@Base 2.3
RTMP_Alloc@Base 2.3
RTMP_ClientPacket@Base 2.3
RTMP_Close@Base 2.3
RTMP_Connect0@Base 2.3
RTMP_Connect1@Base 2.3
RTMP_Connect@Base 2.3
RTMP_ConnectStream@Base 2.3
RTMP_DefaultFlashVer@Base 2.3
RTMP_DeleteStream@Base 2.3
RTMP_DropRequest@Base 2.3
RTMP_EnableWrite@Base 2.3
RTMP_FindFirstMatchingProperty@Base 2.3
RTMP_FindPrefixProperty@Base 2.3
RTMP_Free@Base 2.3
RTMP_GetDuration@Base 2.3
RTMP_GetNextMediaPacket@Base 2.3
RTMP_GetTime@Base 2.3
RTMP_HashSWF@Base 2.3
RTMP_Init@Base 2.3
RTMP_IsConnected@Base 2.3
RTMP_IsTimedout@Base 2.3
RTMP_LibVersion@Base 2.3
RTMP_Log@Base 2.3
RTMP_LogGetLevel@Base 2.3
RTMP_LogHex@Base 2.3
RTMP_LogHexString@Base 2.3
RTMP_LogPrintf@Base 2.3
RTMP_LogSetCallback@Base 2.3
RTMP_LogSetLevel@Base 2.3
RTMP_LogSetOutput@Base 2.3
RTMP_LogStatus@Base 2.3
RTMP_ParsePlaypath@Base 2.3
RTMP_ParseURL@Base 2.3
RTMP_Pause@Base 2.3
RTMP_Read@Base 2.3
RTMP_ReadPacket@Base 2.3
RTMP_ReconnectStream@Base 2.3
RTMP_SendChunk@Base 2.3
RTMP_SendClientBW@Base 2.3
RTMP_SendCreateStream@Base 2.3
RTMP_SendCtrl@Base 2.3
RTMP_SendPacket@Base 2.3
RTMP_SendPause@Base 2.3
RTMP_SendSeek@Base 2.3
RTMP_SendServerBW@Base 2.3
RTMP_Serve@Base 2.3
RTMP_SetBufferMS@Base 2.3
RTMP_SetOpt@Base 2.3
RTMP_SetupStream@Base 2.3
RTMP_SetupURL@Base 2.3
RTMP_Socket@Base 2.3
RTMP_TLS_Init@Base 2.3
RTMP_TLS_ctx@Base 2.3
RTMP_ToggleStream@Base 2.3
RTMP_UpdateBufferMS@Base 2.3
RTMP_UserInterrupt@Base 2.3
RTMP_Write@Base 2.3
RTMP_ctrlC@Base 2.3
RTMP_debuglevel@Base 2.3
From: siretart@tauware.de
Subject: allow package to build via debian/rules
Forwarded: not-needed
Upstream objects to this:
13:57 <siretart> hyc: this allows building rtmpdump when your makefile is executed via
another makefile
13:57 <hyc> siretart: the BSD guys will object
13:57 <siretart> hyc: this is the case for debian packages, debian/rules, the main
buildscript, is implementd in make
13:57 <hyc> make -C only works with gnumake
13:57 <hyc> look in the svn history, you'll see that it used to use make -C
13:57 <siretart> hm, then I'll probably need to carry a local distro patch
13:59 <hyc> and why doesn't $(MAKE) $(MAKEFLAGS) work?
14:00 <siretart> symptom: 'no rule to make target "w"'
14:01 <hyc> that's a gmake bug
14:04 <siretart> hm. probably. the use of MAKEFLAGS is at least described in the gmake manual
5.7.3
---
Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- rtmpdump.orig/Makefile
+++ rtmpdump/Makefile
@@ -64,11 +64,11 @@ install: $(PROGS)
cp rtmpgw$(EXT) rtmpsrv$(EXT) rtmpsuck$(EXT) $(SBINDIR)
cp rtmpdump.1 $(MANDIR)/man1
cp rtmpgw.8 $(MANDIR)/man8
- @cd librtmp; $(MAKE) install
+ $(MAKE) -C librtmp install
clean:
rm -f *.o rtmpdump$(EXT) rtmpgw$(EXT) rtmpsrv$(EXT) rtmpsuck$(EXT)
- @cd librtmp; $(MAKE) clean
+ $(MAKE) -C librtmp clean
FORCE:
01_unbreak_makefile.diff
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
MAKEVARS=prefix=/usr CRYPTO=GNUTLS libdir=/usr/lib/$(DEB_HOST_MULTIARCH)
override_dh_auto_build:
dh_auto_build -- $(MAKEVARS)
override_dh_auto_install:
dh_auto_install -- $(MAKEVARS)
override_dh_auto_clean:
rm -rf get-orig-source
dh_auto_clean
get-orig-source:
debian/get-git-source.sh
%:
dh $@
unapply-patches
abort-on-upstream-changes
# See uscan(1) for format
version=3
http://rtmpdump.mplayerhq.hu/download/rtmpdump-(.*)\.(?:tgz|tar\.gz)
......@@ -29,7 +29,7 @@ LIBZ=-lz
LIBS_posix=
LIBS_darwin=
LIBS_mingw=-lws2_32 -lwinmm -lgdi32
LIB_GNUTLS=-lgnutls -lgcrypt $(LIBZ)
LIB_GNUTLS=-lgnutls -lhogweed -lnettle -lgmp $(LIBZ)
LIB_OPENSSL=-lssl -lcrypto $(LIBZ)
LIB_POLARSSL=-lpolarssl $(LIBZ)
PRIVATE_LIBS=$(LIBS_$(SYS))
......@@ -41,11 +41,11 @@ PUBLIC_LIBS=$(PUB_$(CRYPTO))
SO_VERSION=1
SOX_posix=so
SOX_darwin=dylib
SOX_mingw=so # useless
SOX_mingw=dll
SOX=$(SOX_$(SYS))
SO_posix=$(SOX).$(SO_VERSION)
SO_darwin=$(SO_VERSION).$(SOX)
SO_mingw=dll
SO_posix=.$(SOX).$(SO_VERSION)
SO_darwin=.$(SO_VERSION).$(SOX)
SO_mingw=-$(SO_VERSION).$(SOX)
SO_EXT=$(SO_$(SYS))
SODIR_posix=$(LIBDIR)
......@@ -66,7 +66,7 @@ INSTALL_IMPLIB=$(INSTALL_IMPLIB_$(SYS))
SHARED=yes
SODEF_yes=-fPIC
SOLIB_yes=librtmp.$(SO_EXT)
SOLIB_yes=librtmp$(SO_EXT)
SOINST_yes=install_so
SO_DEF=$(SODEF_$(SHARED))
SO_LIB=$(SOLIB_$(SHARED))
......@@ -83,12 +83,12 @@ OBJS=rtmp.o log.o amf.o hashswf.o parseurl.o
all: librtmp.a $(SO_LIB)
clean:
rm -f *.o *.a *.$(SOX) *.$(SO_EXT) librtmp.pc
rm -f *.o *.a *.$(SOX) *$(SO_EXT) librtmp.pc
librtmp.a: $(OBJS)
$(AR) rs $@ $?
librtmp.$(SO_EXT): $(OBJS)
librtmp$(SO_EXT): $(OBJS)
$(CC) $(SO_LDFLAGS) $(LDFLAGS) -o $@ $^ $> $(CRYPTO_LIB)
ln -sf $@ librtmp.$(SOX)
......@@ -114,8 +114,8 @@ install_base: librtmp.a librtmp.pc
cp librtmp.pc $(LIBDIR)/pkgconfig
cp librtmp.3 $(MANDIR)/man3
install_so: librtmp.$(SO_EXT)
cp librtmp.$(SO_EXT) $(SODIR)
install_so: librtmp$(SO_EXT)
cp librtmp$(SO_EXT) $(SODIR)
$(INSTALL_IMPLIB)
cd $(SODIR); ln -sf librtmp.$(SO_EXT) librtmp.$(SOX)
cd $(SODIR); ln -sf librtmp$(SO_EXT) librtmp.$(SOX)
......@@ -396,6 +396,14 @@ AMFProp_Encode(AMFObjectProperty *prop, char *pBuffer, char *pBufEnd)
pBuffer = AMF_Encode(&prop->p_vu.p_object, pBuffer, pBufEnd);
break;
case AMF_ECMA_ARRAY:
pBuffer = AMF_EncodeEcmaArray(&prop->p_vu.p_object, pBuffer, pBufEnd);
break;
case AMF_STRICT_ARRAY:
pBuffer = AMF_EncodeArray(&prop->p_vu.p_object, pBuffer, pBufEnd);
break;
default:
RTMP_Log(RTMP_LOGERROR, "%s, invalid type. %d", __FUNCTION__, prop->p_type);
pBuffer = NULL;
......@@ -700,7 +708,6 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize,
if (nRes == -1)
return -1;
nSize -= nRes;
prop->p_type = AMF_OBJECT;
break;
}
case AMF_OBJECT_END:
......@@ -718,7 +725,6 @@ AMFProp_Decode(AMFObjectProperty *prop, const char *pBuffer, int nSize,
if (nRes == -1)
return -1;
nSize -= nRes;
prop->p_type = AMF_OBJECT;
break;
}
case AMF_DATE:
......@@ -815,6 +821,18 @@ AMFProp_Dump(AMFObjectProperty *prop)
AMF_Dump(&prop->p_vu.p_object);
return;
}
else if (prop->p_type == AMF_ECMA_ARRAY)
{
RTMP_Log(RTMP_LOGDEBUG, "Property: <%sECMA_ARRAY>", strRes);
AMF_Dump(&prop->p_vu.p_object);
return;
}
else if (prop->p_type == AMF_STRICT_ARRAY)
{
RTMP_Log(RTMP_LOGDEBUG, "Property: <%sSTRICT_ARRAY>", strRes);
AMF_Dump(&prop->p_vu.p_object);
return;
}
switch (prop->p_type)
{
......@@ -889,6 +907,76 @@ AMF_Encode(AMFObject *obj, char *pBuffer, char *pBufEnd)
return pBuffer;
}
char *
AMF_EncodeEcmaArray(AMFObject *obj, char *pBuffer, char *pBufEnd)
{
int i;
if (pBuffer+4 >= pBufEnd)
return NULL;
*pBuffer++ = AMF_ECMA_ARRAY;
pBuffer = AMF_EncodeInt32(pBuffer, pBufEnd, obj->o_num);
for (i = 0; i < obj->o_num; i++)
{
char *res = AMFProp_Encode(&obj->o_props[i], pBuffer, pBufEnd);
if (res == NULL)
{
RTMP_Log(RTMP_LOGERROR, "AMF_Encode - failed to encode property in index %d",
i);
break;
}
else
{
pBuffer = res;
}
}
if (pBuffer + 3 >= pBufEnd)
return NULL; /* no room for the end marker */
pBuffer = AMF_EncodeInt24(pBuffer, pBufEnd, AMF_OBJECT_END);
return pBuffer;
}
char *
AMF_EncodeArray(AMFObject *obj, char *pBuffer, char *pBufEnd)
{
int i;
if (pBuffer+4 >= pBufEnd)
return NULL;
*pBuffer++ = AMF_STRICT_ARRAY;
pBuffer = AMF_EncodeInt32(pBuffer, pBufEnd, obj->o_num);
for (i = 0; i < obj->o_num; i++)
{
char *res = AMFProp_Encode(&obj->o_props[i], pBuffer, pBufEnd);
if (res == NULL)
{
RTMP_Log(RTMP_LOGERROR, "AMF_Encode - failed to encode property in index %d",
i);
break;
}
else
{
pBuffer = res;
}
}
//if (pBuffer + 3 >= pBufEnd)
// return NULL; /* no room for the end marker */
//pBuffer = AMF_EncodeInt24(pBuffer, pBufEnd, AMF_OBJECT_END);
return pBuffer;
}
int
AMF_DecodeArray(AMFObject *obj, const char *pBuffer, int nSize,
int nArrayLen, int bDecodeName)
......@@ -1122,7 +1210,7 @@ AMF_GetProp(AMFObject *obj, const AVal *name, int nIndex)
{
if (nIndex >= 0)
{
if (nIndex <= obj->o_num)
if (nIndex < obj->o_num)
return &obj->o_props[nIndex];
}
else
......
......@@ -104,6 +104,9 @@ extern "C"
double AMF_DecodeNumber(const char *data);
char *AMF_Encode(AMFObject * obj, char *pBuffer, char *pBufEnd);
char *AMF_EncodeEcmaArray(AMFObject *obj, char *pBuffer, char *pBufEnd);
char *AMF_EncodeArray(AMFObject *obj, char *pBuffer, char *pBufEnd);
int AMF_Decode(AMFObject * obj, const char *pBuffer, int nSize,
int bDecodeName);
int AMF_DecodeArray(AMFObject * obj, const char *pBuffer, int nSize,
......
......@@ -43,21 +43,24 @@ typedef arc4_context * RC4_handle;
#define RC4_free(h) free(h)
#elif defined(USE_GNUTLS)
#include <gcrypt.h>
#include <nettle/hmac.h>
#include <nettle/arcfour.h>
#ifndef SHA256_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH 32
#endif
#define HMAC_CTX gcry_md_hd_t
#define HMAC_setup(ctx, key, len) gcry_md_open(&ctx, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC); gcry_md_setkey(ctx, key, len)
#define HMAC_crunch(ctx, buf, len) gcry_md_write(ctx, buf, len)
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; memcpy(dig, gcry_md_read(ctx, 0), dlen); gcry_md_close(ctx)
typedef gcry_cipher_hd_t RC4_handle;
#define RC4_alloc(h) gcry_cipher_open(h, GCRY_CIPHER_ARCFOUR, GCRY_CIPHER_MODE_STREAM, 0)
#define RC4_setkey(h,l,k) gcry_cipher_setkey(h,k,l)
#define RC4_encrypt(h,l,d) gcry_cipher_encrypt(h,(void *)d,l,NULL,0)
#define RC4_encrypt2(h,l,s,d) gcry_cipher_encrypt(h,(void *)d,l,(void *)s,l)
#define RC4_free(h) gcry_cipher_close(h)
#undef HMAC_CTX
#define HMAC_CTX struct hmac_sha256_ctx
#define HMAC_setup(ctx, key, len) hmac_sha256_set_key(&ctx, len, key)
#define HMAC_crunch(ctx, buf, len) hmac_sha256_update(&ctx, len, buf)
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; hmac_sha256_digest(&ctx, SHA256_DIGEST_LENGTH, dig)
#define HMAC_close(ctx)
typedef struct arcfour_ctx* RC4_handle;
#define RC4_alloc(h) *h = malloc(sizeof(struct arcfour_ctx))
#define RC4_setkey(h,l,k) arcfour_set_key(h, l, k)
#define RC4_encrypt(h,l,d) arcfour_crypt(h,l,(uint8_t *)d,(uint8_t *)d)
#define RC4_encrypt2(h,l,s,d) arcfour_crypt(h,l,(uint8_t *)d,(uint8_t *)s)
#define RC4_free(h) free(h)
#else /* USE_OPENSSL */
#include <openssl/sha.h>
......
......@@ -42,16 +42,16 @@
#define HMAC_finish(ctx, dig, dlen) dlen = SHA256_DIGEST_LENGTH; sha2_hmac_finish(&ctx, dig)
#define HMAC_close(ctx)
#elif defined(USE_GNUTLS)
#include <gnutls/gnutls.h>
#include <gcrypt.h>
#include <nettle/hmac.h>
#ifndef SHA256_DIGEST_LENGTH
#define SHA256_DIGEST_LENGTH 32
#endif
#define HMAC_CTX gcry_md_hd_t
#define HMAC_setup(ctx, key, len) gcry_md_open(&ctx, GCRY_MD_SHA256, GCRY_MD_FLAG_HMAC); gcry_md_setkey(ctx, key, len)