diff options
author | millert <> | 2002-02-19 19:39:38 +0000 |
---|---|---|
committer | millert <> | 2002-02-19 19:39:38 +0000 |
commit | 0be1f7d80eff8e3e86b037958be3ab5217ce9b59 (patch) | |
tree | 9e6b3b31919b853c473f13c35c4878ac3aef84ab /src/lib/libc/crypt | |
parent | 97ec74faebf84f0ecbbf3706ec05647d012003c9 (diff) | |
download | openbsd-0be1f7d80eff8e3e86b037958be3ab5217ce9b59.tar.gz openbsd-0be1f7d80eff8e3e86b037958be3ab5217ce9b59.tar.bz2 openbsd-0be1f7d80eff8e3e86b037958be3ab5217ce9b59.zip |
We live in an ANSI C world. Remove lots of gratuitous #ifdef __STDC__ cruft.
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r-- | src/lib/libc/crypt/bcrypt.c | 33 | ||||
-rw-r--r-- | src/lib/libc/crypt/blowfish.c | 86 |
2 files changed, 2 insertions, 117 deletions
diff --git a/src/lib/libc/crypt/bcrypt.c b/src/lib/libc/crypt/bcrypt.c index f3ea849f00..dec0093dd8 100644 --- a/src/lib/libc/crypt/bcrypt.c +++ b/src/lib/libc/crypt/bcrypt.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bcrypt.c,v 1.15 2002/02/16 21:27:21 millert Exp $ */ | 1 | /* $OpenBSD: bcrypt.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
@@ -97,16 +97,8 @@ const static u_int8_t index_64[128] = | |||
97 | }; | 97 | }; |
98 | #define CHAR64(c) ( (c) > 127 ? 255 : index_64[(c)]) | 98 | #define CHAR64(c) ( (c) > 127 ? 255 : index_64[(c)]) |
99 | 99 | ||
100 | #ifdef __STDC__ | ||
101 | static void | 100 | static void |
102 | decode_base64(u_int8_t *buffer, u_int16_t len, u_int8_t *data) | 101 | decode_base64(u_int8_t *buffer, u_int16_t len, u_int8_t *data) |
103 | #else | ||
104 | static void | ||
105 | decode_base64(buffer, len, data) | ||
106 | u_int8_t *buffer; | ||
107 | u_int16_t len; | ||
108 | u_int8_t *data; | ||
109 | #endif | ||
110 | { | 102 | { |
111 | u_int8_t *bp = buffer; | 103 | u_int8_t *bp = buffer; |
112 | u_int8_t *p = data; | 104 | u_int8_t *p = data; |
@@ -140,17 +132,8 @@ decode_base64(buffer, len, data) | |||
140 | } | 132 | } |
141 | } | 133 | } |
142 | 134 | ||
143 | #ifdef __STDC__ | ||
144 | static void | 135 | static void |
145 | encode_salt(char *salt, u_int8_t *csalt, u_int16_t clen, u_int8_t logr) | 136 | encode_salt(char *salt, u_int8_t *csalt, u_int16_t clen, u_int8_t logr) |
146 | #else | ||
147 | static void | ||
148 | encode_salt(salt, csalt, clen, logr) | ||
149 | char *salt; | ||
150 | u_int8_t *csalt; | ||
151 | u_int16_t clen; | ||
152 | u_int8_t logr; | ||
153 | #endif | ||
154 | { | 137 | { |
155 | salt[0] = '$'; | 138 | salt[0] = '$'; |
156 | salt[1] = BCRYPT_VERSION; | 139 | salt[1] = BCRYPT_VERSION; |
@@ -166,14 +149,8 @@ encode_salt(salt, csalt, clen, logr) | |||
166 | seems sensible. | 149 | seems sensible. |
167 | */ | 150 | */ |
168 | 151 | ||
169 | #ifdef __STDC__ | ||
170 | char * | 152 | char * |
171 | bcrypt_gensalt(u_int8_t log_rounds) | 153 | bcrypt_gensalt(u_int8_t log_rounds) |
172 | #else | ||
173 | char * | ||
174 | bcrypt_gensalt(log_rounds) | ||
175 | u_int8_t log_rounds; | ||
176 | #endif | ||
177 | { | 154 | { |
178 | u_int8_t csalt[BCRYPT_MAXSALT]; | 155 | u_int8_t csalt[BCRYPT_MAXSALT]; |
179 | u_int16_t i; | 156 | u_int16_t i; |
@@ -296,16 +273,8 @@ bcrypt(key, salt) | |||
296 | return encrypted; | 273 | return encrypted; |
297 | } | 274 | } |
298 | 275 | ||
299 | #ifdef __STDC__ | ||
300 | static void | 276 | static void |
301 | encode_base64(u_int8_t *buffer, u_int8_t *data, u_int16_t len) | 277 | encode_base64(u_int8_t *buffer, u_int8_t *data, u_int16_t len) |
302 | #else | ||
303 | static void | ||
304 | encode_base64(buffer, data, len) | ||
305 | u_int8_t *buffer; | ||
306 | u_int8_t *data; | ||
307 | u_int16_t len; | ||
308 | #endif | ||
309 | { | 278 | { |
310 | u_int8_t *bp = buffer; | 279 | u_int8_t *bp = buffer; |
311 | u_int8_t *p = data; | 280 | u_int8_t *p = data; |
diff --git a/src/lib/libc/crypt/blowfish.c b/src/lib/libc/crypt/blowfish.c index 695fc00a6a..8be04a6463 100644 --- a/src/lib/libc/crypt/blowfish.c +++ b/src/lib/libc/crypt/blowfish.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: blowfish.c,v 1.15 2001/01/04 21:45:30 todd Exp $ */ | 1 | /* $OpenBSD: blowfish.c,v 1.16 2002/02/19 19:39:36 millert Exp $ */ |
2 | /* | 2 | /* |
3 | * Blowfish block cipher for OpenBSD | 3 | * Blowfish block cipher for OpenBSD |
4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> | 4 | * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> |
@@ -402,16 +402,8 @@ Blowfish_initstate(c) | |||
402 | 402 | ||
403 | } | 403 | } |
404 | 404 | ||
405 | #ifdef __STDC__ | ||
406 | u_int32_t | 405 | u_int32_t |
407 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) | 406 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, u_int16_t *current) |
408 | #else | ||
409 | u_int32_t | ||
410 | Blowfish_stream2word(data, databytes, current) | ||
411 | const u_int8_t *data; | ||
412 | u_int16_t databytes; | ||
413 | u_int16_t *current; | ||
414 | #endif | ||
415 | { | 407 | { |
416 | u_int8_t i; | 408 | u_int8_t i; |
417 | u_int16_t j; | 409 | u_int16_t j; |
@@ -430,16 +422,8 @@ Blowfish_stream2word(data, databytes, current) | |||
430 | return temp; | 422 | return temp; |
431 | } | 423 | } |
432 | 424 | ||
433 | #if __STDC__ | ||
434 | void | 425 | void |
435 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) | 426 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) |
436 | #else | ||
437 | void | ||
438 | Blowfish_expand0state(c, key, keybytes) | ||
439 | blf_ctx *c; | ||
440 | const u_int8_t *key; | ||
441 | u_int16_t keybytes; | ||
442 | #endif | ||
443 | { | 427 | { |
444 | u_int16_t i; | 428 | u_int16_t i; |
445 | u_int16_t j; | 429 | u_int16_t j; |
@@ -476,19 +460,9 @@ Blowfish_expand0state(c, key, keybytes) | |||
476 | } | 460 | } |
477 | 461 | ||
478 | 462 | ||
479 | #if __STDC__ | ||
480 | void | 463 | void |
481 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, | 464 | Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, |
482 | const u_int8_t *key, u_int16_t keybytes) | 465 | const u_int8_t *key, u_int16_t keybytes) |
483 | #else | ||
484 | void | ||
485 | Blowfish_expandstate(c, data, databytes, key, keybytes) | ||
486 | blf_ctx *c; | ||
487 | const u_int8_t *data; | ||
488 | u_int16_t databytes; | ||
489 | const u_int8_t *key; | ||
490 | u_int16_t keybytes; | ||
491 | #endif | ||
492 | { | 466 | { |
493 | u_int16_t i; | 467 | u_int16_t i; |
494 | u_int16_t j; | 468 | u_int16_t j; |
@@ -529,16 +503,8 @@ Blowfish_expandstate(c, data, databytes, key, keybytes) | |||
529 | 503 | ||
530 | } | 504 | } |
531 | 505 | ||
532 | #if __STDC__ | ||
533 | void | 506 | void |
534 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) | 507 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) |
535 | #else | ||
536 | void | ||
537 | blf_key(c, k, len) | ||
538 | blf_ctx *c; | ||
539 | const u_int8_t *k; | ||
540 | u_int16_t len; | ||
541 | #endif | ||
542 | { | 508 | { |
543 | /* Initialize S-boxes and subkeys with Pi */ | 509 | /* Initialize S-boxes and subkeys with Pi */ |
544 | Blowfish_initstate(c); | 510 | Blowfish_initstate(c); |
@@ -547,16 +513,8 @@ blf_key(c, k, len) | |||
547 | Blowfish_expand0state(c, k, len); | 513 | Blowfish_expand0state(c, k, len); |
548 | } | 514 | } |
549 | 515 | ||
550 | #if __STDC__ | ||
551 | void | 516 | void |
552 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 517 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
553 | #else | ||
554 | void | ||
555 | blf_enc(c, data, blocks) | ||
556 | blf_ctx *c; | ||
557 | u_int32_t *data; | ||
558 | u_int16_t blocks; | ||
559 | #endif | ||
560 | { | 518 | { |
561 | u_int32_t *d; | 519 | u_int32_t *d; |
562 | u_int16_t i; | 520 | u_int16_t i; |
@@ -568,16 +526,8 @@ blf_enc(c, data, blocks) | |||
568 | } | 526 | } |
569 | } | 527 | } |
570 | 528 | ||
571 | #if __STDC__ | ||
572 | void | 529 | void |
573 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 530 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
574 | #else | ||
575 | void | ||
576 | blf_dec(c, data, blocks) | ||
577 | blf_ctx *c; | ||
578 | u_int32_t *data; | ||
579 | u_int16_t blocks; | ||
580 | #endif | ||
581 | { | 531 | { |
582 | u_int32_t *d; | 532 | u_int32_t *d; |
583 | u_int16_t i; | 533 | u_int16_t i; |
@@ -589,16 +539,8 @@ blf_dec(c, data, blocks) | |||
589 | } | 539 | } |
590 | } | 540 | } |
591 | 541 | ||
592 | #if __STDC__ | ||
593 | void | 542 | void |
594 | blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | 543 | blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) |
595 | #else | ||
596 | void | ||
597 | blf_ecb_encrypt(c, data, len) | ||
598 | blf_ctx *c; | ||
599 | u_int8_t *data; | ||
600 | u_int32_t len; | ||
601 | #endif | ||
602 | { | 544 | { |
603 | u_int32_t l, r; | 545 | u_int32_t l, r; |
604 | u_int32_t i; | 546 | u_int32_t i; |
@@ -619,16 +561,8 @@ blf_ecb_encrypt(c, data, len) | |||
619 | } | 561 | } |
620 | } | 562 | } |
621 | 563 | ||
622 | #if __STDC__ | ||
623 | void | 564 | void |
624 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | 565 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) |
625 | #else | ||
626 | void | ||
627 | blf_ecb_decrypt(c, data, len) | ||
628 | blf_ctx *c; | ||
629 | u_int8_t *data; | ||
630 | u_int32_t len; | ||
631 | #endif | ||
632 | { | 566 | { |
633 | u_int32_t l, r; | 567 | u_int32_t l, r; |
634 | u_int32_t i; | 568 | u_int32_t i; |
@@ -649,17 +583,8 @@ blf_ecb_decrypt(c, data, len) | |||
649 | } | 583 | } |
650 | } | 584 | } |
651 | 585 | ||
652 | #if __STDC__ | ||
653 | void | 586 | void |
654 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) | 587 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) |
655 | #else | ||
656 | void | ||
657 | blf_cbc_encrypt(c, iv, data, len) | ||
658 | blf_ctx *c; | ||
659 | u_int8_t *iv; | ||
660 | u_int8_t *data; | ||
661 | u_int32_t len; | ||
662 | #endif | ||
663 | { | 588 | { |
664 | u_int32_t l, r; | 589 | u_int32_t l, r; |
665 | u_int32_t i, j; | 590 | u_int32_t i, j; |
@@ -683,17 +608,8 @@ blf_cbc_encrypt(c, iv, data, len) | |||
683 | } | 608 | } |
684 | } | 609 | } |
685 | 610 | ||
686 | #if __STDC__ | ||
687 | void | 611 | void |
688 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) | 612 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) |
689 | #else | ||
690 | void | ||
691 | blf_cbc_decrypt(c, iva, data, len) | ||
692 | blf_ctx *c; | ||
693 | u_int8_t *iva; | ||
694 | u_int8_t *data; | ||
695 | u_int32_t len; | ||
696 | #endif | ||
697 | { | 613 | { |
698 | u_int32_t l, r; | 614 | u_int32_t l, r; |
699 | u_int8_t *iv; | 615 | u_int8_t *iv; |