Skip to content

Commit d568228

Browse files
Sashanesyr
authored andcommitted
s/err/error where apropriate easiest way to fix liner issues on windows
1 parent af6fc94 commit d568228

File tree

10 files changed

+55
-55
lines changed

10 files changed

+55
-55
lines changed

source/evp_fetch.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
size_t *counts;
6262
OSSL_TIME max_time;
6363

64-
int err = 0;
64+
int error = 0;
6565
int pq = 0;
6666

6767
static int threadcount;
@@ -194,7 +194,7 @@ void do_fetch(size_t num)
194194
fetch_alg = exclusive_fetch_alg;
195195
}
196196

197-
if (err == 1)
197+
if (error == 1)
198198
return;
199199

200200
switch (j) {
@@ -203,7 +203,7 @@ void do_fetch(size_t num)
203203
fetch_entries[j].propq);
204204
if (md == NULL) {
205205
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
206-
err = 1;
206+
error = 1;
207207
return;
208208
}
209209
EVP_MD_free(md);
@@ -214,7 +214,7 @@ void do_fetch(size_t num)
214214
fetch_entries[j].propq);
215215
if (cph == NULL) {
216216
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
217-
err = 1;
217+
error = 1;
218218
return;
219219
}
220220
EVP_CIPHER_free(cph);
@@ -225,7 +225,7 @@ void do_fetch(size_t num)
225225
fetch_entries[j].propq);
226226
if (kdf == NULL) {
227227
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
228-
err = 1;
228+
error = 1;
229229
return;
230230
}
231231
EVP_KDF_free(kdf);
@@ -236,7 +236,7 @@ void do_fetch(size_t num)
236236
fetch_entries[j].propq);
237237
if (mac == NULL) {
238238
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
239-
err = 1;
239+
error = 1;
240240
return;
241241
}
242242
EVP_MAC_free(mac);
@@ -247,7 +247,7 @@ void do_fetch(size_t num)
247247
fetch_entries[j].propq);
248248
if (rnd == NULL) {
249249
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
250-
err = 1;
250+
error = 1;
251251
return;
252252
}
253253
EVP_RAND_free(rnd);
@@ -258,7 +258,7 @@ void do_fetch(size_t num)
258258
fetch_entries[j].propq);
259259
if (kem == NULL) {
260260
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
261-
err = 1;
261+
error = 1;
262262
return;
263263
}
264264
EVP_KEM_free(kem);
@@ -269,14 +269,14 @@ void do_fetch(size_t num)
269269
fetch_entries[j].propq);
270270
if (sig == NULL) {
271271
fprintf(stderr, "Failed to fetch %s\n", fetch_alg);
272-
err = 1;
272+
error = 1;
273273
return;
274274
}
275275
EVP_SIGNATURE_free(sig);
276276
break;
277277
}
278278
default:
279-
err = 1;
279+
error = 1;
280280
return;
281281
}
282282
counts[num]++;
@@ -372,7 +372,7 @@ int main(int argc, char *argv[])
372372
goto out;
373373
}
374374

375-
if (err) {
375+
if (error) {
376376
printf("Error during test\n");
377377
goto out;
378378
}

source/evp_setpeer.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
#define RUN_TIME 5
2626

27-
int err = 0;
27+
int error = 0;
2828

2929
size_t num_calls;
3030
static int threadcount;
@@ -42,13 +42,13 @@ void do_setpeer(size_t num)
4242

4343
pkey_ctx = EVP_PKEY_CTX_new(pkey, NULL);
4444
if (pkey_ctx == NULL) {
45-
err = 1;
45+
error = 1;
4646
printf("Failed to create pkey_ctx\n");
4747
return;
4848
}
4949

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

5959
do {
6060
if (EVP_PKEY_derive_set_peer(pkey_ctx, pkey) <= 0) {
61-
err = 1;
61+
error = 1;
6262
break;
6363
}
6464
counts[num]++;
@@ -97,7 +97,7 @@ static double get_avcalltime(void)
9797

9898
static void report_result(int key_id, int terse)
9999
{
100-
if (err) {
100+
if (error) {
101101
fprintf(stderr, "Error during test of %s\n",
102102
sample_names[key_id]);
103103
exit(EXIT_FAILURE);
@@ -228,7 +228,7 @@ int main(int argc, char *argv[])
228228
EVP_PKEY_free(pkey);
229229
}
230230

231-
if (err) {
231+
if (error) {
232232
printf("Error during test\n");
233233
goto out;
234234
}

source/handshake.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
#define RUN_TIME 5
2727

28-
int err = 0;
28+
int error = 0;
2929

3030
typedef enum {
3131
INIT_LIB_CTX,
@@ -102,7 +102,7 @@ static void do_handshake(size_t num)
102102
} while (time.t < max_time.t);
103103

104104
if (!ret)
105-
err = 1;
105+
error = 1;
106106
}
107107

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

@@ -132,7 +132,7 @@ static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
132132
privkey)) {
133133
ERR_print_errors_fp(stderr);
134134
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
135-
err = 1;
135+
error = 1;
136136
return;
137137
}
138138
}
@@ -157,7 +157,7 @@ static void do_handshake_ossl_lib_ctx_per_thread(size_t num)
157157
SSL_CTX_free(lcctx);
158158

159159
if (!ret)
160-
err = 1;
160+
error = 1;
161161

162162
OSSL_LIB_CTX_free(libctx);
163163
}
@@ -187,7 +187,7 @@ static void do_handshake_ctx_pool(size_t num)
187187
privkey)) {
188188
ERR_print_errors_fp(stderr);
189189
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
190-
err = 1;
190+
error = 1;
191191
return;
192192
}
193193
}
@@ -203,7 +203,7 @@ static void do_handshake_ctx_pool(size_t num)
203203
privkey)) {
204204
ERR_print_errors_fp(stderr);
205205
fprintf(stderr, "%s:%d: Failed to create SSL_CTX pair\n", __FILE__, __LINE__);
206-
err = 1;
206+
error = 1;
207207
return;
208208
}
209209
}
@@ -230,7 +230,7 @@ static void do_handshake_ctx_pool(size_t num)
230230
}
231231

232232
if (!ret)
233-
err = 1;
233+
error = 1;
234234
}
235235

236236
static void free_ctx_pool()
@@ -482,7 +482,7 @@ int main(int argc, char * const argv[])
482482
goto err;
483483
};
484484

485-
if (err) {
485+
if (error) {
486486
printf("Error during test\n");
487487
goto err;
488488
}

source/newrawkey.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ enum {
3737
} algorithm = ALGO_X25519;
3838
const char *alg_name = "X25519";
3939

40-
int err = 0;
40+
int error = 0;
4141

4242
static unsigned char key_x25519[32] = {
4343
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b,
@@ -377,7 +377,7 @@ void do_newrawkey(size_t num)
377377
sizeof(key_data));
378378
#endif
379379
if (pkey == NULL)
380-
err = 1;
380+
error = 1;
381381
else
382382
EVP_PKEY_free(pkey);
383383
counts[num]++;
@@ -451,7 +451,7 @@ int main(int argc, char *argv[])
451451
goto out;
452452
}
453453

454-
if (err) {
454+
if (error) {
455455
printf("Error during test\n");
456456
goto out;
457457
}

source/pkeyread.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ size_t num_calls;
5050
size_t *counts;
5151
OSSL_TIME max_time;
5252

53-
int err = 0;
53+
int error = 0;
5454

5555
static int threadcount;
5656

@@ -69,7 +69,7 @@ static void do_pemread(size_t num)
6969

7070
if (sample_id >= SAMPLE_ALL) {
7171
fprintf(stderr, "%s no sample key set for test\n", __func__);
72-
err = 1;
72+
error = 1;
7373
return;
7474
}
7575

@@ -80,7 +80,7 @@ static void do_pemread(size_t num)
8080
if (pem == NULL) {
8181
fprintf(stderr, "%s Cannot create mem BIO [%s PEM]\n",
8282
__func__, sample_names[sample_id]);
83-
err = 1;
83+
error = 1;
8484
return;
8585
}
8686

@@ -93,14 +93,14 @@ static void do_pemread(size_t num)
9393
if (key == NULL) {
9494
fprintf(stderr, "Failed to create key [%s PEM]\n",
9595
sample_names[sample_id]);
96-
err = 1;
96+
error = 1;
9797
goto end;
9898
}
9999
EVP_PKEY_free(key);
100100
if (BIO_reset(pem) == 0) {
101101
fprintf(stderr, "Failed to reset BIO [%s PEM]\n",
102102
sample_names[sample_id]);
103-
err = 1;
103+
error = 1;
104104
goto end;
105105
}
106106

@@ -130,7 +130,7 @@ static void do_derread(size_t num)
130130

131131
if (sample_id >= SAMPLE_ALL) {
132132
fprintf(stderr, "%s no sample key set for test\n", __func__);
133-
err = 1;
133+
error = 1;
134134
return;
135135
}
136136

@@ -144,7 +144,7 @@ static void do_derread(size_t num)
144144
if (pkey == NULL) {
145145
fprintf(stderr, "%s pkey is NULL [%s DER]\n",
146146
__func__, sample_names[sample_id]);
147-
err = 1;
147+
error = 1;
148148
goto error;
149149
}
150150
error:
@@ -238,7 +238,7 @@ static void report_result(int key_id, int format_id, int verbosity)
238238
{
239239
struct call_times times = { 0 };
240240

241-
if (err) {
241+
if (error) {
242242
fprintf(stderr, "Error during test of %s in %s format\n",
243243
sample_names[key_id], format_names[format_id]);
244244
exit(EXIT_FAILURE);

source/randbytes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ size_t num_calls;
2828
size_t *counts;
2929
OSSL_TIME max_time;
3030

31-
int err = 0;
31+
int error = 0;
3232

3333
static int threadcount;
3434

@@ -42,7 +42,7 @@ void do_randbytes(size_t num)
4242

4343
do {
4444
if (!RAND_bytes(buf, sizeof(buf)))
45-
err = 1;
45+
error = 1;
4646
counts[num]++;
4747
time = ossl_time_now();
4848
} while (time.t < max_time.t);
@@ -92,7 +92,7 @@ int main(int argc, char *argv[])
9292
goto out;
9393
}
9494

95-
if (err) {
95+
if (error) {
9696
printf("Error during test\n");
9797
goto out;
9898
}

source/rsasign.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
#define RUN_TIME 5
2828

29-
int err = 0;
29+
int error = 0;
3030
EVP_PKEY *rsakey = NULL;
3131

3232
size_t *counts;
@@ -61,7 +61,7 @@ void do_rsasign(size_t num)
6161
if (EVP_PKEY_sign_init(ctx) <= 0
6262
|| EVP_PKEY_sign(ctx, sig, &siglen, (const unsigned char*)tbs,
6363
SHA_DIGEST_LENGTH) <= 0) {
64-
err = 1;
64+
error = 1;
6565
break;
6666
}
6767
counts[num]++;
@@ -130,7 +130,7 @@ int main(int argc, char *argv[])
130130
goto out;
131131
}
132132

133-
if (err) {
133+
if (error) {
134134
printf("Error during test\n");
135135
goto out;
136136
}

0 commit comments

Comments
 (0)