From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 5D237460BF for ; Tue, 4 Jul 2023 18:51:19 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BC41568C60F; Tue, 4 Jul 2023 21:51:08 +0300 (EEST) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7F95A68C5C5 for ; Tue, 4 Jul 2023 21:51:02 +0300 (EEST) Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6b5d7e60015so4917443a34.0 for ; Tue, 04 Jul 2023 11:51:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688496661; x=1691088661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=pLnkIHkavCvhFktvMQG4bVmGQvTIcTAgfl4U3BEFak0=; b=GxcwMszZafsc8gnSNH+4Do1a6Qgtu0u8F2KhZsFpz+fIVjB0awHgeTDLuXtSHPkzN+ yrEewBlNdDyw9qx0ZtCgaOVpM/PyoBxIB9hfAsUy99axMOOQfkgCJD5kxXJXF5NzBvux ClcgC4sgvmDf922Jn8eScjo+Vry37RJHH6FwCnmuPmunfbG+8xGKZ6pXU7Zj/YZ1MV9c CaVFyQ64q300HNY4aeWH7urlQRtdKcM7VS0UaDg+h4SyLELvagxUtsyEBc0jMY0skB7K 9EHaQUgVdIZE4fWj7nk1l0OynTXIDj7PDos7A168a8em5wdKlGVpXvbaXuylFiqdaZdq 1fGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688496661; x=1691088661; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pLnkIHkavCvhFktvMQG4bVmGQvTIcTAgfl4U3BEFak0=; b=ROKe4oK0NED+CvAJsQqj6KPQ/Y0s2Q2YlQ/INvkPxFG9FyWb2tIu1tDjfMd+RiA2/R Sa96KLf33BZU1skBg2hnrNZ2ZpkKRw+xk2LT94gNQBUelng9YuFuO3dXnJC7KyVB8mjh 4N/CL+AwLmVRgXwYIN1fnPeJRapECwOW8XN82xzkLnSCReE8sJd7HWdtvPYZMdoqggSN X3u7IPL1Hnvs76hvUNJsb+3cgeqr1B8zzSPiSTaI4Lvn8rHgmwGo9e0pgw/Ju8ag67JW G7a8ZiHwnyzVvlL5e4IxxBWKrLNJdoYNUq5lYGoyx/FadQ8mRuSqJMDVcRkL5yXfgBZY eeoQ== X-Gm-Message-State: AC+VfDw67IbZ4f7m/NNtVJb9SDNxRiztPyFekIZiZbgb1gLElOFfyXXV e26D0wPq+SoA4QD/jt/NXm5uWfwLcn4= X-Google-Smtp-Source: ACHHUZ5UID/LFQn9hTeaak0uREq8u4O1myiT2Wsr6dmQ7w/X0mzJ8IxHeP95PfvaFmqTJ/ZL5GstSA== X-Received: by 2002:a9d:758b:0:b0:6b8:691b:cd9a with SMTP id s11-20020a9d758b000000b006b8691bcd9amr13977300otk.21.1688496660809; Tue, 04 Jul 2023 11:51:00 -0700 (PDT) Received: from localhost.localdomain (host197.190-225-105.telecom.net.ar. [190.225.105.197]) by smtp.gmail.com with ESMTPSA id l25-20020a9d7a99000000b006b71deb7809sm4112739otn.14.2023.07.04.11.50.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Jul 2023 11:51:00 -0700 (PDT) From: James Almer To: ffmpeg-devel@ffmpeg.org Date: Tue, 4 Jul 2023 15:50:44 -0300 Message-ID: <20230704185044.2154-2-jamrial@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230704185044.2154-1-jamrial@gmail.com> References: <20230704185044.2154-1-jamrial@gmail.com> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/2] avutil/random_seed: ass support for gcrypt and OpenSSL as source of randomness X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Signed-off-by: James Almer --- I put these after /dev/random/ to not change the current behavior of av_get_random_seed(), but if either of these are prefered i can move them up. configure | 2 +- libavutil/random_seed.c | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 107d533b3e..d6e78297fe 100755 --- a/configure +++ b/configure @@ -3892,7 +3892,7 @@ avfilter_deps="avutil" avfilter_suggest="libm stdatomic" avformat_deps="avcodec avutil" avformat_suggest="libm network zlib stdatomic" -avutil_suggest="clock_gettime ffnvcodec libm libdrm libmfx opencl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic" +avutil_suggest="clock_gettime ffnvcodec gcrypt libm libdrm libmfx opencl openssl user32 vaapi vulkan videotoolbox corefoundation corevideo coremedia bcrypt stdatomic" postproc_deps="avutil gpl" postproc_suggest="libm stdatomic" swresample_deps="avutil" diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 39fb27c5ad..e8967c0cfe 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -30,6 +30,11 @@ #include #include #endif +#if CONFIG_GCRYPT +#include +#elif CONFIG_OPENSSL +#include +#endif #include #include #include @@ -144,6 +149,14 @@ int av_random(uint8_t* buf, size_t len) return 0; #endif +#if CONFIG_GCRYPT + gcry_randomize(buf, len, GCRY_VERY_STRONG_RANDOM); + return 0; +#elif CONFIG_OPENSSL + if (RAND_bytes(buf, len)) + return 0; +#endif + return AVERROR_INVALIDDATA; } -- 2.41.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".