diff options
author | guenther <> | 2015-09-11 09:18:27 +0000 |
---|---|---|
committer | guenther <> | 2015-09-11 09:18:27 +0000 |
commit | b0404dc3aed5b42933d7f9650d2a9f6e0620f34c (patch) | |
tree | 54b7815c87b1e17a76f16279310a2867b9a1ef00 /src/lib/libc/crypt | |
parent | c041f863310ba8ab2a1bce7605887f1deff68a38 (diff) | |
download | openbsd-b0404dc3aed5b42933d7f9650d2a9f6e0620f34c.tar.gz openbsd-b0404dc3aed5b42933d7f9650d2a9f6e0620f34c.tar.bz2 openbsd-b0404dc3aed5b42933d7f9650d2a9f6e0620f34c.zip |
Wrap blowfish, sha*, md5, and rmd160 so that internal calls go direct
ok deraadt@
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r-- | src/lib/libc/crypt/blowfish.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/lib/libc/crypt/blowfish.c b/src/lib/libc/crypt/blowfish.c index c337df8a0a..a658e602d2 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.18 2004/11/02 17:23:26 hshoexer Exp $ */ | 1 | /* $OpenBSD: blowfish.c,v 1.19 2015/09/11 09:18:27 guenther 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> |
@@ -87,6 +87,7 @@ Blowfish_encipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) | |||
87 | *xl = Xr ^ p[17]; | 87 | *xl = Xr ^ p[17]; |
88 | *xr = Xl; | 88 | *xr = Xl; |
89 | } | 89 | } |
90 | DEF_WEAK(Blowfish_encipher); | ||
90 | 91 | ||
91 | void | 92 | void |
92 | Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) | 93 | Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) |
@@ -112,6 +113,7 @@ Blowfish_decipher(blf_ctx *c, u_int32_t *xl, u_int32_t *xr) | |||
112 | *xl = Xr ^ p[0]; | 113 | *xl = Xr ^ p[0]; |
113 | *xr = Xl; | 114 | *xr = Xl; |
114 | } | 115 | } |
116 | DEF_WEAK(Blowfish_decipher); | ||
115 | 117 | ||
116 | void | 118 | void |
117 | Blowfish_initstate(blf_ctx *c) | 119 | Blowfish_initstate(blf_ctx *c) |
@@ -391,6 +393,7 @@ Blowfish_initstate(blf_ctx *c) | |||
391 | 393 | ||
392 | *c = initstate; | 394 | *c = initstate; |
393 | } | 395 | } |
396 | DEF_WEAK(Blowfish_initstate); | ||
394 | 397 | ||
395 | u_int32_t | 398 | u_int32_t |
396 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, | 399 | Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, |
@@ -412,6 +415,7 @@ Blowfish_stream2word(const u_int8_t *data, u_int16_t databytes, | |||
412 | *current = j; | 415 | *current = j; |
413 | return temp; | 416 | return temp; |
414 | } | 417 | } |
418 | DEF_WEAK(Blowfish_stream2word); | ||
415 | 419 | ||
416 | void | 420 | void |
417 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) | 421 | Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) |
@@ -449,6 +453,7 @@ Blowfish_expand0state(blf_ctx *c, const u_int8_t *key, u_int16_t keybytes) | |||
449 | } | 453 | } |
450 | } | 454 | } |
451 | } | 455 | } |
456 | DEF_WEAK(Blowfish_expand0state); | ||
452 | 457 | ||
453 | 458 | ||
454 | void | 459 | void |
@@ -493,6 +498,7 @@ Blowfish_expandstate(blf_ctx *c, const u_int8_t *data, u_int16_t databytes, | |||
493 | } | 498 | } |
494 | 499 | ||
495 | } | 500 | } |
501 | DEF_WEAK(Blowfish_expandstate); | ||
496 | 502 | ||
497 | void | 503 | void |
498 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) | 504 | blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) |
@@ -503,6 +509,7 @@ blf_key(blf_ctx *c, const u_int8_t *k, u_int16_t len) | |||
503 | /* Transform S-boxes and subkeys with key */ | 509 | /* Transform S-boxes and subkeys with key */ |
504 | Blowfish_expand0state(c, k, len); | 510 | Blowfish_expand0state(c, k, len); |
505 | } | 511 | } |
512 | DEF_WEAK(blf_key); | ||
506 | 513 | ||
507 | void | 514 | void |
508 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 515 | blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
@@ -516,6 +523,7 @@ blf_enc(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | |||
516 | d += 2; | 523 | d += 2; |
517 | } | 524 | } |
518 | } | 525 | } |
526 | DEF_WEAK(blf_enc); | ||
519 | 527 | ||
520 | void | 528 | void |
521 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | 529 | blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) |
@@ -529,6 +537,7 @@ blf_dec(blf_ctx *c, u_int32_t *data, u_int16_t blocks) | |||
529 | d += 2; | 537 | d += 2; |
530 | } | 538 | } |
531 | } | 539 | } |
540 | DEF_WEAK(blf_dec); | ||
532 | 541 | ||
533 | void | 542 | void |
534 | 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) |
@@ -551,6 +560,7 @@ blf_ecb_encrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | |||
551 | data += 8; | 560 | data += 8; |
552 | } | 561 | } |
553 | } | 562 | } |
563 | DEF_WEAK(blf_ecb_encrypt); | ||
554 | 564 | ||
555 | void | 565 | void |
556 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | 566 | blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) |
@@ -573,6 +583,7 @@ blf_ecb_decrypt(blf_ctx *c, u_int8_t *data, u_int32_t len) | |||
573 | data += 8; | 583 | data += 8; |
574 | } | 584 | } |
575 | } | 585 | } |
586 | DEF_WEAK(blf_ecb_decrypt); | ||
576 | 587 | ||
577 | void | 588 | void |
578 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) | 589 | blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) |
@@ -598,6 +609,7 @@ blf_cbc_encrypt(blf_ctx *c, u_int8_t *iv, u_int8_t *data, u_int32_t len) | |||
598 | data += 8; | 609 | data += 8; |
599 | } | 610 | } |
600 | } | 611 | } |
612 | DEF_WEAK(blf_cbc_encrypt); | ||
601 | 613 | ||
602 | void | 614 | void |
603 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) | 615 | blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) |
@@ -639,6 +651,7 @@ blf_cbc_decrypt(blf_ctx *c, u_int8_t *iva, u_int8_t *data, u_int32_t len) | |||
639 | for (j = 0; j < 8; j++) | 651 | for (j = 0; j < 8; j++) |
640 | data[j] ^= iva[j]; | 652 | data[j] ^= iva[j]; |
641 | } | 653 | } |
654 | DEF_WEAK(blf_cbc_decrypt); | ||
642 | 655 | ||
643 | #if 0 | 656 | #if 0 |
644 | void | 657 | void |