Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread Anton Khirnov
Quoting James Almer (2023-07-04 22:18:40) > On 7/4/2023 5:14 PM, Anton Khirnov wrote: > > Quoting James Almer (2023-07-04 22:08:40) > >> On 7/4/2023 4:59 PM, Anton Khirnov wrote: > > Not if any of the functions above were called but failed to fill the > buffer. > > I could

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread James Almer
On 7/4/2023 5:14 PM, Anton Khirnov wrote: Quoting James Almer (2023-07-04 22:08:40) On 7/4/2023 4:59 PM, Anton Khirnov wrote: Not if any of the functions above were called but failed to fill the buffer. I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and return AVERROR_INVALIDD

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread Anton Khirnov
Quoting James Almer (2023-07-04 22:08:40) > > RAND_bytes from OpenSSL returns 0 or -1 on error, so nothing i can > propagate. That's AVERROR_EXTERNAL then. -- Anton Khirnov ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mail

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread Anton Khirnov
Quoting James Almer (2023-07-04 22:08:40) > On 7/4/2023 4:59 PM, Anton Khirnov wrote: > >> > >> Not if any of the functions above were called but failed to fill the > >> buffer. > >> > >> I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and > >> return AVERROR_INVALIDDATA outside. >

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread James Almer
On 7/4/2023 4:59 PM, Anton Khirnov wrote: Not if any of the functions above were called but failed to fill the buffer. I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and return AVERROR_INVALIDDATA outside. AVERROR_INVALIDDATA is defined as 'Invalid data found when processing i

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread Anton Khirnov
> > Not if any of the functions above were called but failed to fill the buffer. > > I could add return AVERROR(ENOSYS) to the HAVE_UNISTD_H block, and > return AVERROR_INVALIDDATA outside. AVERROR_INVALIDDATA is defined as 'Invalid data found when processing input'. This function does not proc

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread James Almer
On 7/4/2023 4:34 PM, Marton Balint wrote: On Tue, 4 Jul 2023, James Almer wrote: Uses the existing code for av_get_random_seed() to return a buffer with cryptographically secure random data, or an error if none could be generated. Signed-off-by: James Almer --- TODO: APIChanges entry and

Re: [FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread Marton Balint
On Tue, 4 Jul 2023, James Almer wrote: Uses the existing code for av_get_random_seed() to return a buffer with cryptographically secure random data, or an error if none could be generated. Signed-off-by: James Almer --- TODO: APIChanges entry and minor version bump. Also, if a new random.h

[FFmpeg-devel] [PATCH 1/2] avutil/random_seed: add av_random()

2023-07-04 Thread James Almer
Uses the existing code for av_get_random_seed() to return a buffer with cryptographically secure random data, or an error if none could be generated. Signed-off-by: James Almer --- TODO: APIChanges entry and minor version bump. Also, if a new random.h header is prefered, i can move the prototype