Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b37e882
x509storeissuer: factor out usage printing
esyr Oct 20, 2025
c201051
s/err/error where apropriate easiest way to fix liner issues on windows
Sashan Sep 29, 2025
948ffbd
Use perflib/err.h unconditionally
esyr Sep 25, 2025
2b3b804
perflib: add vwarn/err/warn
esyr Sep 25, 2025
ec81797
x509storeissuer: use errx/warnx for error message output
esyr Oct 20, 2025
7bbc211
x509storeissuer: factor out integer parameter parsing into a separate…
esyr Oct 20, 2025
a76d93b
x509storeissuer: provide the initial infrastructure for nonce configu…
esyr Oct 20, 2025
7e32341
x509storeissuer: add ability to configure verbosity level
esyr Oct 20, 2025
6b9361a
x509storeissuer: unify funtion definition formatting
esyr Oct 20, 2025
3924835
x509storeissuer: add -T option to specify the run time
esyr Oct 20, 2025
0b3b091
x509storeissuer: support providing multiple certificate directories
esyr Oct 20, 2025
c7f19dc
x509storeissuer: reduce the rate ossl_time_now() queries
esyr Oct 21, 2025
effd1b7
x509storeissuer: count the iterations in a local variable to avoid ha…
esyr Oct 21, 2025
a4c199d
x509storeissuer: tolerate X509_STORE_CTX_get1_issuer() successes, cou…
esyr Oct 21, 2025
be2a738
x509storeissuer: add certificates from the provided directories to th…
esyr Oct 21, 2025
cfceddc
x509storeissuer: add and option to configure X509_STORE_CTX sharing
esyr Oct 21, 2025
eba7d40
x509storeissuer: report the store size before the test run if the ver…
esyr Oct 22, 2025
cfee934
x509storeissuer: make the verbose reporting more elaborate
esyr Oct 22, 2025
d9944aa
x509storeissuer: generate some certificates and add them to the store
esyr Oct 22, 2025
5ff2ce9
x509storeissuer: add support for gernerated nonces
esyr Oct 22, 2025
f7875b4
x509storeissuer: add ability to add certificates to the store during …
esyr Oct 22, 2025
61d211f
x509storeissuer: make thread_data cache-line-aligned
esyr Oct 23, 2025
ccbb791
.github/workflows/test.yml: do not build OpenSSL apps and tests
esyr Oct 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: "Config openssl build"
working-directory: "./openssl"
run: |
./config --prefix="$PWD/dist"
./config no-apps no-tests --prefix="$PWD/dist"
- name: "Build openssl"
working-directory: "./openssl"
run: |
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
- name: "Config openssl build"
working-directory: "./openssl"
run: |
./config --prefix="$PWD/dist"
./config no-apps no-tests --prefix="$PWD/dist"
- name: "Build openssl"
working-directory: "./openssl"
run: |
Expand Down Expand Up @@ -143,7 +143,7 @@ jobs:
shutdown_vm: false
run: |
cd openssl
./config --prefix="$PWD/dist"
./config no-apps no-tests --prefix="$PWD/dist"
- name: "Build openssl"
uses: "cross-platform-actions/action@fe0167d8082ac584754ef3ffb567fded22642c7d" #v0.27.0
with:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
shell: cmd
run: |
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
perl Configure no-makedepend
perl Configure no-makedepend no-apps no-tests
- name: "Build openssl"
working-directory: ".\\openssl"
shell: cmd
Expand Down Expand Up @@ -257,7 +257,7 @@ jobs:
- name: "Config openssl build"
working-directory: "./openssl"
run: |
./config --prefix="$PWD/dist"
./config no-apps no-tests --prefix="$PWD/dist"
- name: "Build openssl"
working-directory: "./openssl"
run: |
Expand Down
14 changes: 8 additions & 6 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ if(WIN32)
target_sources(perf PRIVATE perflib/getopt.c perflib/basename.c perflib/err.c)
endif()

if(WIN32)
set(libm_dep)
else()
set(libm_dep PUBLIC m)
endif()

target_include_directories(perf PUBLIC "${PROJECT_SOURCE_DIR}")
target_link_libraries(perf PUBLIC OpenSSL::SSL OpenSSL::Crypto)

Expand Down Expand Up @@ -154,17 +160,13 @@ add_executable(rsasign rsasign.c)
target_link_libraries(rsasign PRIVATE perf)

add_executable(x509storeissuer x509storeissuer.c)
target_link_libraries(x509storeissuer PRIVATE perf)
target_link_libraries(x509storeissuer ${libm_dep} PRIVATE perf)

add_executable(rwlocks rwlocks.c)
target_link_libraries(rwlocks PRIVATE perf)

add_executable(pkeyread pkeyread.c)
if(WIN32)
target_link_libraries(pkeyread PRIVATE perf)
else()
target_link_libraries(pkeyread PUBLIC m PRIVATE perf)
endif()
target_link_libraries(pkeyread ${libm_dep} PRIVATE perf)

add_executable(evp_setpeer evp_setpeer.c)
target_link_libraries(evp_setpeer PRIVATE perf)
Expand Down
22 changes: 11 additions & 11 deletions source/evp_fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
size_t *counts;
OSSL_TIME max_time;

int err = 0;
int error = 0;
int pq = 0;

static int threadcount;
Expand Down Expand Up @@ -194,7 +194,7 @@ void do_fetch(size_t num)
fetch_alg = exclusive_fetch_alg;
}

if (err == 1)
if (error == 1)
return;

switch (j) {
Expand All @@ -203,7 +203,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (md == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_MD_free(md);
Expand All @@ -214,7 +214,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (cph == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_CIPHER_free(cph);
Expand All @@ -225,7 +225,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (kdf == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_KDF_free(kdf);
Expand All @@ -236,7 +236,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (mac == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_MAC_free(mac);
Expand All @@ -247,7 +247,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (rnd == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_RAND_free(rnd);
Expand All @@ -258,7 +258,7 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (kem == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_KEM_free(kem);
Expand All @@ -269,14 +269,14 @@ void do_fetch(size_t num)
fetch_entries[j].propq);
if (sig == NULL) {
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
err = 1;
error = 1;
return;
}
EVP_SIGNATURE_free(sig);
break;
}
default:
err = 1;
error = 1;
return;
}
counts[num]++;
Expand Down Expand Up @@ -372,7 +372,7 @@ int main(int argc, char *argv[])
goto out;
}

if (err) {
if (error) {
printf("Error during test\n");
goto out;
}
Expand Down
12 changes: 6 additions & 6 deletions source/evp_setpeer.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#define RUN_TIME 5

int err = 0;
int error = 0;

size_t num_calls;
static int threadcount;
Expand All @@ -42,13 +42,13 @@ void do_setpeer(size_t num)

pkey_ctx = EVP_PKEY_CTX_new(pkey, NULL);
if (pkey_ctx == NULL) {
err = 1;
error = 1;
printf("Failed to create pkey_ctx\n");
return;
}

if (EVP_PKEY_derive_init(pkey_ctx) <= 0) {
err = 1;
error = 1;
printf("Failed to init pkey_ctx\n");
EVP_PKEY_CTX_free(pkey_ctx);
return;
Expand All @@ -58,7 +58,7 @@ void do_setpeer(size_t num)

do {
if (EVP_PKEY_derive_set_peer(pkey_ctx, pkey) <= 0) {
err = 1;
error = 1;
break;
}
counts[num]++;
Expand Down Expand Up @@ -97,7 +97,7 @@ static double get_avcalltime(void)

static void report_result(int key_id, int terse)
{
if (err) {
if (error) {
fprintf(stderr, "Error during test of %s\n",
sample_names[key_id]);
exit(EXIT_FAILURE);
Expand Down Expand Up @@ -228,7 +228,7 @@ int main(int argc, char *argv[])
EVP_PKEY_free(pkey);
}

if (err) {
if (error) {
printf("Error during test\n");
goto out;
}
Expand Down
18 changes: 9 additions & 9 deletions source/handshake.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#define RUN_TIME 5

int err = 0;
int error = 0;

typedef enum {
INIT_LIB_CTX,
Expand Down Expand Up @@ -102,7 +102,7 @@ static void do_handshake(size_t num)
} while (time.t < max_time.t);

if (!ret)
err = 1;
error = 1;
}

static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
Expand All @@ -117,7 +117,7 @@ static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
libctx = OSSL_LIB_CTX_new();
if (libctx == NULL) {
fprintf(stderr, "%s:%d: Failed to create ossl lib context\n", __FILE__, __LINE__);
err = 1;
error = 1;
return;
}

Expand All @@ -132,7 +132,7 @@ static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
privkey)) {
ERR_print_errors_fp(stderr);
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
err = 1;
error = 1;
return;
}
}
Expand All @@ -157,7 +157,7 @@ static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
SSL_CTX_free(lcctx);

if (!ret)
err = 1;
error = 1;

OSSL_LIB_CTX_free(libctx);
}
Expand Down Expand Up @@ -187,7 +187,7 @@ static void do_handshake_ctx_pool(size_t num)
privkey)) {
ERR_print_errors_fp(stderr);
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
err = 1;
error = 1;
return;
}
}
Expand All @@ -203,7 +203,7 @@ static void do_handshake_ctx_pool(size_t num)
privkey)) {
ERR_print_errors_fp(stderr);
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
err = 1;
error = 1;
return;
}
}
Expand All @@ -230,7 +230,7 @@ static void do_handshake_ctx_pool(size_t num)
}

if (!ret)
err = 1;
error = 1;
}

static void free_ctx_pool()
Expand Down Expand Up @@ -482,7 +482,7 @@ int main(int argc, char * const argv[])
goto err;
};

if (err) {
if (error) {
printf("Error during test\n");
goto err;
}
Expand Down
6 changes: 3 additions & 3 deletions source/newrawkey.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ enum {
} algorithm = ALGO_X25519;
const char *alg_name = "X25519";

int err = 0;
int error = 0;

static unsigned char key_x25519[32] = {
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
Expand Down Expand Up @@ -377,7 +377,7 @@ void do_newrawkey(size_t num)
sizeof(key_data));
#endif
if (pkey == NULL)
err = 1;
error = 1;
else
EVP_PKEY_free(pkey);
counts[num]++;
Expand Down Expand Up @@ -451,7 +451,7 @@ int main(int argc, char *argv[])
goto out;
}

if (err) {
if (error) {
printf("Error during test\n");
goto out;
}
Expand Down
36 changes: 36 additions & 0 deletions source/perflib/err.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* https://www.openssl.org/source/license.html
*/

#include <errno.h>
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
Expand All @@ -22,6 +23,20 @@ vwarnx(const char *fmt, va_list ap)
putc('\n', stderr);
}

void
vwarn(const char *fmt, va_list ap)
{
int saved_errno = errno;

if (progname != NULL)
fprintf(stderr, "%s: ", progname);
vfprintf(stderr, fmt, ap);
fprintf(stderr, ": ");

errno = saved_errno;
perror(NULL);
}

void
errx(int status, const char *fmt, ...)
{
Expand All @@ -33,6 +48,17 @@ errx(int status, const char *fmt, ...)
exit(status);
}

void
err(int status, const char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
vwarn(fmt, ap);
va_end(ap);
exit(status);
}

void
warnx(const char *fmt, ...)
{
Expand All @@ -42,3 +68,13 @@ warnx(const char *fmt, ...)
vwarnx(fmt, ap);
va_end(ap);
}

void
warn(const char *fmt, ...)
{
va_list ap;

va_start(ap, fmt);
vwarn(fmt, ap);
va_end(ap);
}
Loading
Loading