diff options
author | tb <> | 2024-11-02 08:54:40 +0000 |
---|---|---|
committer | tb <> | 2024-11-02 08:54:40 +0000 |
commit | 5a3101c1d5e1f9f99c2d29cfd71180caf58af69b (patch) | |
tree | bac3514e7fcb95420abcfd284cbcd8084cf14b64 /src/lib/libcrypto/err/err_prn.c | |
parent | 9284b0981039b2aa54d18a4c55a4abcd02b7de51 (diff) | |
download | openbsd-5a3101c1d5e1f9f99c2d29cfd71180caf58af69b.tar.gz openbsd-5a3101c1d5e1f9f99c2d29cfd71180caf58af69b.tar.bz2 openbsd-5a3101c1d5e1f9f99c2d29cfd71180caf58af69b.zip |
Inline last uses of CRYPTO_THREADID in err/
This is another Thorpian obfuscation scheme hiding nasty casts of
pthread_t to unsigned long and comparing them. We can do this in
a less underhanded way by calling the portable functions directly.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/err/err_prn.c')
-rw-r--r-- | src/lib/libcrypto/err/err_prn.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/libcrypto/err/err_prn.c b/src/lib/libcrypto/err/err_prn.c index fb6e19c54c..4bd9482e61 100644 --- a/src/lib/libcrypto/err/err_prn.c +++ b/src/lib/libcrypto/err/err_prn.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: err_prn.c,v 1.23 2024/03/02 11:37:13 tb Exp $ */ | 1 | /* $OpenBSD: err_prn.c,v 1.24 2024/11/02 08:54:40 tb Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -57,6 +57,7 @@ | |||
57 | */ | 57 | */ |
58 | 58 | ||
59 | #include <limits.h> | 59 | #include <limits.h> |
60 | #include <pthread.h> | ||
60 | #include <stdio.h> | 61 | #include <stdio.h> |
61 | #include <string.h> | 62 | #include <string.h> |
62 | 63 | ||
@@ -66,7 +67,6 @@ | |||
66 | #include <openssl/lhash.h> | 67 | #include <openssl/lhash.h> |
67 | 68 | ||
68 | #include "bio_local.h" | 69 | #include "bio_local.h" |
69 | #include "crypto_local.h" | ||
70 | 70 | ||
71 | void | 71 | void |
72 | ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) | 72 | ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) |
@@ -77,10 +77,8 @@ ERR_print_errors_cb(int (*cb)(const char *str, size_t len, void *u), void *u) | |||
77 | const char *file, *data; | 77 | const char *file, *data; |
78 | int line, flags; | 78 | int line, flags; |
79 | unsigned long es; | 79 | unsigned long es; |
80 | CRYPTO_THREADID cur; | ||
81 | 80 | ||
82 | CRYPTO_THREADID_current(&cur); | 81 | es = (unsigned long)pthread_self(); |
83 | es = CRYPTO_THREADID_hash(&cur); | ||
84 | while ((l = ERR_get_error_line_data(&file, &line, &data, | 82 | while ((l = ERR_get_error_line_data(&file, &line, &data, |
85 | &flags)) != 0) { | 83 | &flags)) != 0) { |
86 | ERR_error_string_n(l, buf, sizeof buf); | 84 | ERR_error_string_n(l, buf, sizeof buf); |