summaryrefslogtreecommitdiff
path: root/libavformat/crypto.c
Commit message (Collapse)AuthorAge
* avformat/crypto.c: remove unnecessary codeSteven Liu2020-07-20
| | | | | | | | Because the newpos variable is set value before use it. The newpos variable declared at the head partition of crypto_seek. Make the code clean. Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
* avformat: Replace ffurl_close() by ffurl_closep() where appropriateAndreas Rheinhardt2020-05-25
| | | | | | | | | | It avoids leaving dangling pointers behind in memory. Also remove redundant checks for whether the URLContext to be closed is already NULL. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* Merge commit 'd860a3cc0a12360a92b9ffd179a0c34413beaf88'Clément Bœsch2017-04-01
|\ | | | | | | | | | | | | | | | | * commit 'd860a3cc0a12360a92b9ffd179a0c34413beaf88': crypto: Add encryption support See 00d4013d9f841c189a2f10dd05526ca40129b880 Merged-by: Clément Bœsch <u@pkh.me>
| * crypto: Add encryption supportChristian Suloway2016-11-17
| | | | | | | | | | | | Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at> Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
* | avformat/crypto: add seeking support on readSimon Hailes2016-08-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cyrpto allows reading of data which has been aes-128-cbc encrypted given a key and an iv. But it did not handle filetypes which require seeking... e.g. it failed on an encrypted .mp4 file. example: take 25.mp4 created with: ffmpeg -f lavfi -i sine=frequency=1000:beep_factor=2:r=48000:duration=720.0 -f lavfi -i testsrc=duration=720.0:rate=25 -vcodec libx264 -cmp 22 -timecode 10:00:00:00 -r 25 -y out\25.mp4 encrypt with: openssl enc -aes-128-cbc -K 12345678901234567890123456789012 -iv 12345678901234567890123456789012 -in 25.mp4 -out 25.enc then to transcode in ffmpeg: ffmpeg -key 12345678901234567890123456789012 -iv 12345678901234567890123456789012 -i crypto:25.enc -vcodec mpeg4 -r 25 -y 25dec.mp4 prior to this modification, the transcode would fail. Note also: crypto previously maked both reads and writes as streamed, which caused the whole file to be read before the transcode started. Now, for read only, if the underlying layer is not marked as streamed, then crypto is not. This should enable efficient reading of encrypted containers which require seeking. Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | libavformat/crypto - encourage reads of 4096 bytesSimon Hailes2016-08-30
| | | | | | | | | | | | | | the current implementation reads in chunks of 149x16=2384 bytes. Seems more logical for it to read in chunks of 4096 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'fab8156b2f30666adabe227b3d7712fd193873b1'Derek Buitenhuis2016-04-21
|\| | | | | | | | | | | | | * commit 'fab8156b2f30666adabe227b3d7712fd193873b1': avio: Copy URLContext generic options into child URLContexts Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * avio: Copy URLContext generic options into child URLContextsMartin Storsjö2016-03-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since all URLContexts have the same AVOptions, such AVOptions will be applied on the outermost context only and removed from the dict, while they probably make sense on all contexts. This makes sure that rw_timeout gets propagated to the innermost URLContext (to make sure it gets passed to the tcp protocol, when opening a http connection for instance). Alternatively, such matching options would be kept in the dict and only removed after the ffurl_connect call. Signed-off-by: Martin Storsjö <martin@martin.st>
| * urlprotocol: receive a list of protocols from the callerAnton Khirnov2016-02-22
| | | | | | | | | | This way, the decisions about which protocols are available for use in any given situations can be delegated to the caller.
* | avformat: Add a protocol blacklisting APIDerek Buitenhuis2016-03-04
| | | | | | | | Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
* | Merge commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d'Derek Buitenhuis2016-02-29
|\| | | | | | | | | | | | | | | | | | | | | This commit also disables the async fate test, because it used internal APIs in a non-kosher way, which no longer exists. * commit '2758cdedfb7ac61f8b5e4861f99218b6fd43491d': lavf: reorganize URLProtocols Merged-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
| * lavf: reorganize URLProtocolsAnton Khirnov2016-02-22
| | | | | | | | | | | | | | | | | | | | Instead of a linked list constructed at av_register_all(), store them in a constant array of pointers. Since no registration is necessary now, this removes some global state from lavf. This will also allow the urlprotocol layer caller to limit the available protocols in a simple and flexible way in the following commits.
* | Update demuxers and protocols for protocol whitelist supportMichael Niedermayer2016-02-02
| | | | | | | | | | Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* | Merge commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e'Michael Niedermayer2015-02-14
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'daf8cf358a098a903d59adb6c0d0cc3262a8c93e': avformat: Don't anonymously typedef structs Conflicts: libavformat/adtsenc.c libavformat/aiffenc.c libavformat/avidec.c libavformat/gif.c libavformat/iff.c libavformat/img2dec.c libavformat/jvdec.c libavformat/matroskadec.c libavformat/udp.c libavformat/wtvdec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * avformat: Don't anonymously typedef structsDiego Biurrun2015-02-14
| |
* | avformat/crypto: fix key vs iv typoMichael Niedermayer2014-12-09
| | | | | | | | | | | | Fixes Ticket 4167 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/crypto: Use av_memdup()Michael Niedermayer2014-12-02
| | | | | | | | Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | avformat/crypto: added encryptionChristian Suloway2014-12-02
| | | | | | | | | | Signed-off-by: Christian Suloway <csuloway@globaleagleent.com> Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* | Reinstate proper FFmpeg license for all files.Thilo Borgmann2013-08-30
| |
* | Merge commit 'e002e3291e6dc7953f843abf56fc14f08f238b21'Michael Niedermayer2012-10-12
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e002e3291e6dc7953f843abf56fc14f08f238b21': Use the new aes/md5/sha/tree allocation functions avutil: Add functions for allocating opaque contexts for algorithms svq3: fix pointer type warning svq3: replace unsafe pointer casting with intreadwrite macros parseutils-test: various cleanups Conflicts: doc/APIchanges libavcodec/svq3.c libavutil/parseutils.c libavutil/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
| * Use the new aes/md5/sha/tree allocation functionsMartin Storsjö2012-10-11
| | | | | | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* | crypto should allow passing of options to the underlying protocol via the ↵Duncan Salerno2012-10-09
|/ | | | | | url_open2 interface Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
* crypto: Remove a stray double spaceMartin Storsjö2012-08-31
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* avio: add support for passing options to protocols.Anton Khirnov2011-11-13
| | | | | Not used anywhere yet, support for passing options from avio_open() will follow.
* avio: Add an AVIOInterruptCB parameter to ffurl_open/ffurl_allocMartin Storsjö2011-11-13
| | | | | Change all uses of these function to pass the relevant callback on.
* crypto: add decoding flag to options.Anton Khirnov2011-11-10
|
* crypto: Don't manually free memory allocated via AVOptionsMartin Storsjö2011-11-10
| | | | Signed-off-by: Martin Storsjö <martin@martin.st>
* AVOptions: rename FF_OPT_TYPE_* => AV_OPT_TYPE_*Anton Khirnov2011-10-12
|
* crypto: Use av_freep instead of av_freeEtienne Buira2011-06-08
| | | | | | This fixes a potential double free. Signed-off-by: Martin Storsjö <martin@martin.st>
* lavf: use designated initializers for AVClasses.Anton Khirnov2011-05-17
|
* crypto: Use av_freep instead of av_freeMartin Storsjö2011-04-24
| | | | | | Using av_freep is generally good practice. Signed-off-by: Martin Storsjö <martin@martin.st>
* Add a protocol handler for AES CBC decryption with PKCS7 paddingMartin Storsjö2011-04-23
This can later be extended to support other AES bit sizes, encryption, other crypto algorithms, reading the key from a URL, etc. In order to use it, the key and initialization vector has to be passed via AVOptions. Since such options can't be passed to protocols from the command line, the protocol is currently only for libavformat internal use. Signed-off-by: Martin Storsjö <martin@martin.st>