diff options
| author | 2023-06-30 23:30:13 +0200 | |
|---|---|---|
| committer | 2023-06-30 23:30:13 +0200 | |
| commit | 52ab7b76f76ee0464fd150ec881ce50fbf2dc001 (patch) | |
| tree | 3b2ee64ea5f8a42ed64c01f59b2fd752b23fd546 | |
| parent | f4c30d501eaf5a2c1a386af6a2295dd0029304e9 (diff) | |
| download | libimobiledevice-52ab7b76f76ee0464fd150ec881ce50fbf2dc001.tar.gz libimobiledevice-52ab7b76f76ee0464fd150ec881ce50fbf2dc001.tar.bz2 | |
3rd_party/libsrp6a-sha512: Update function definitions to modern style
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/t_conv.c | 35 | ||||
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/t_math.c | 103 | ||||
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/t_misc.c | 21 | ||||
| -rw-r--r-- | 3rd_party/libsrp6a-sha512/t_truerand.c | 3 |
4 files changed, 40 insertions, 122 deletions
diff --git a/3rd_party/libsrp6a-sha512/t_conv.c b/3rd_party/libsrp6a-sha512/t_conv.c index f7f50e2..76d4e58 100644 --- a/3rd_party/libsrp6a-sha512/t_conv.c +++ b/3rd_party/libsrp6a-sha512/t_conv.c | |||
| @@ -33,8 +33,7 @@ | |||
| 33 | #include "cstr.h" | 33 | #include "cstr.h" |
| 34 | 34 | ||
| 35 | static int | 35 | static int |
| 36 | hexDigitToInt(c) | 36 | hexDigitToInt(char c) |
| 37 | char c; | ||
| 38 | { | 37 | { |
| 39 | if(c >= '0' && c <= '9') | 38 | if(c >= '0' && c <= '9') |
| 40 | return c - '0'; | 39 | return c - '0'; |
| @@ -50,9 +49,7 @@ hexDigitToInt(c) | |||
| 50 | * Convert a hex string to a string of bytes; return size of dst | 49 | * Convert a hex string to a string of bytes; return size of dst |
| 51 | */ | 50 | */ |
| 52 | _TYPE( int ) | 51 | _TYPE( int ) |
| 53 | t_fromhex(dst, src) | 52 | t_fromhex(char *dst, const char *src) |
| 54 | char * dst; | ||
| 55 | const char * src; | ||
| 56 | { | 53 | { |
| 57 | register char *chp = dst; | 54 | register char *chp = dst; |
| 58 | register unsigned size = strlen(src); | 55 | register unsigned size = strlen(src); |
| @@ -76,10 +73,7 @@ t_fromhex(dst, src) | |||
| 76 | * Convert a string of bytes to their hex representation | 73 | * Convert a string of bytes to their hex representation |
| 77 | */ | 74 | */ |
| 78 | _TYPE( char * ) | 75 | _TYPE( char * ) |
| 79 | t_tohex(dst, src, size) | 76 | t_tohex(char *dst, const char *src, unsigned size) |
| 80 | char * dst; | ||
| 81 | const char * src; | ||
| 82 | unsigned size; | ||
| 83 | { | 77 | { |
| 84 | int notleading = 0; | 78 | int notleading = 0; |
| 85 | 79 | ||
| @@ -103,10 +97,7 @@ t_tohex(dst, src, size) | |||
| 103 | } | 97 | } |
| 104 | 98 | ||
| 105 | _TYPE( char * ) | 99 | _TYPE( char * ) |
| 106 | t_tohexcstr(dst, src, size) | 100 | t_tohexcstr(cstr *dst, const char *src, unsigned size) |
| 107 | cstr * dst; | ||
| 108 | const char * src; | ||
| 109 | unsigned size; | ||
| 110 | { | 101 | { |
| 111 | cstr_set_length(dst, 2 * size + 1); | 102 | cstr_set_length(dst, 2 * size + 1); |
| 112 | return t_tohex(dst->data, src, size); | 103 | return t_tohex(dst->data, src, size); |
| @@ -119,9 +110,7 @@ static char b64table[] = | |||
| 119 | * Convert a base64 string into raw byte array representation. | 110 | * Convert a base64 string into raw byte array representation. |
| 120 | */ | 111 | */ |
| 121 | _TYPE( int ) | 112 | _TYPE( int ) |
| 122 | t_fromb64(dst, src) | 113 | t_fromb64(char *dst, const char *src) |
| 123 | char * dst; | ||
| 124 | const char * src; | ||
| 125 | { | 114 | { |
| 126 | unsigned char *a; | 115 | unsigned char *a; |
| 127 | char *loc; | 116 | char *loc; |
| @@ -179,9 +168,7 @@ t_fromb64(dst, src) | |||
| 179 | } | 168 | } |
| 180 | 169 | ||
| 181 | _TYPE( int ) | 170 | _TYPE( int ) |
| 182 | t_cstrfromb64(dst, src) | 171 | t_cstrfromb64(cstr *dst, const char *src) |
| 183 | cstr * dst; | ||
| 184 | const char * src; | ||
| 185 | { | 172 | { |
| 186 | int len; | 173 | int len; |
| 187 | cstr_set_length(dst, (strlen(src) * 6 + 7) / 8); | 174 | cstr_set_length(dst, (strlen(src) * 6 + 7) / 8); |
| @@ -194,10 +181,7 @@ t_cstrfromb64(dst, src) | |||
| 194 | * Convert a raw byte string into a null-terminated base64 ASCII string. | 181 | * Convert a raw byte string into a null-terminated base64 ASCII string. |
| 195 | */ | 182 | */ |
| 196 | _TYPE( char * ) | 183 | _TYPE( char * ) |
| 197 | t_tob64(dst, src, size) | 184 | t_tob64(char *dst, const char *src, unsigned size) |
| 198 | char * dst; | ||
| 199 | const char * src; | ||
| 200 | unsigned size; | ||
| 201 | { | 185 | { |
| 202 | int c, pos = size % 3; | 186 | int c, pos = size % 3; |
| 203 | unsigned char b0 = 0, b1 = 0, b2 = 0, notleading = 0; | 187 | unsigned char b0 = 0, b1 = 0, b2 = 0, notleading = 0; |
| @@ -248,10 +232,7 @@ t_tob64(dst, src, size) | |||
| 248 | } | 232 | } |
| 249 | 233 | ||
| 250 | _TYPE( char * ) | 234 | _TYPE( char * ) |
| 251 | t_tob64cstr(dst, src, sz) | 235 | t_tob64cstr(cstr *dst, const char *src, unsigned int sz) |
| 252 | cstr * dst; | ||
| 253 | const char * src; | ||
| 254 | unsigned int sz; | ||
| 255 | { | 236 | { |
| 256 | cstr_set_length(dst, (sz * 8 + 5) / 6 + 1); | 237 | cstr_set_length(dst, (sz * 8 + 5) / 6 + 1); |
| 257 | return t_tob64(dst->data, src, sz); | 238 | return t_tob64(dst->data, src, sz); |
diff --git a/3rd_party/libsrp6a-sha512/t_math.c b/3rd_party/libsrp6a-sha512/t_math.c index e655daa..166ee4c 100644 --- a/3rd_party/libsrp6a-sha512/t_math.c +++ b/3rd_party/libsrp6a-sha512/t_math.c | |||
| @@ -99,8 +99,7 @@ typedef void * BigIntegerModAccel; | |||
| 99 | /* Math library interface stubs */ | 99 | /* Math library interface stubs */ |
| 100 | 100 | ||
| 101 | BigInteger | 101 | BigInteger |
| 102 | BigIntegerFromInt(n) | 102 | BigIntegerFromInt(unsigned int n) |
| 103 | unsigned int n; | ||
| 104 | { | 103 | { |
| 105 | #ifdef OPENSSL | 104 | #ifdef OPENSSL |
| 106 | BIGNUM * a = BN_new(); | 105 | BIGNUM * a = BN_new(); |
| @@ -136,9 +135,7 @@ BigIntegerFromInt(n) | |||
| 136 | } | 135 | } |
| 137 | 136 | ||
| 138 | BigInteger | 137 | BigInteger |
| 139 | BigIntegerFromBytes(bytes, length) | 138 | BigIntegerFromBytes(const unsigned char *bytes, int length) |
| 140 | const unsigned char * bytes; | ||
| 141 | int length; | ||
| 142 | { | 139 | { |
| 143 | #ifdef OPENSSL | 140 | #ifdef OPENSSL |
| 144 | BIGNUM * a = BN_new(); | 141 | BIGNUM * a = BN_new(); |
| @@ -206,10 +203,7 @@ BigIntegerFromBytes(bytes, length) | |||
| 206 | } | 203 | } |
| 207 | 204 | ||
| 208 | int | 205 | int |
| 209 | BigIntegerToBytes(src, dest, destlen) | 206 | BigIntegerToBytes(BigInteger src, unsigned char *dest, int destlen) |
| 210 | BigInteger src; | ||
| 211 | unsigned char * dest; | ||
| 212 | int destlen; | ||
| 213 | { | 207 | { |
| 214 | #ifdef OPENSSL | 208 | #ifdef OPENSSL |
| 215 | return BN_bn2bin(src, dest); | 209 | return BN_bn2bin(src, dest); |
| @@ -290,10 +284,7 @@ BigIntegerToCstrEx(BigInteger x, cstr * out, int len) | |||
| 290 | } | 284 | } |
| 291 | 285 | ||
| 292 | BigIntegerResult | 286 | BigIntegerResult |
| 293 | BigIntegerToHex(src, dest, destlen) | 287 | BigIntegerToHex(BigInteger src, char *dest, int destlen) |
| 294 | BigInteger src; | ||
| 295 | char * dest; | ||
| 296 | int destlen; | ||
| 297 | { | 288 | { |
| 298 | #ifdef OPENSSL | 289 | #ifdef OPENSSL |
| 299 | strncpy(dest, BN_bn2hex(src), destlen); | 290 | strncpy(dest, BN_bn2hex(src), destlen); |
| @@ -317,11 +308,7 @@ static char b64table[] = | |||
| 317 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./"; | 308 | "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz./"; |
| 318 | 309 | ||
| 319 | BigIntegerResult | 310 | BigIntegerResult |
| 320 | BigIntegerToString(src, dest, destlen, radix) | 311 | BigIntegerToString(BigInteger src, char *dest, int destlen, unsigned int radix) |
| 321 | BigInteger src; | ||
| 322 | char * dest; | ||
| 323 | int destlen; | ||
| 324 | unsigned int radix; | ||
| 325 | { | 312 | { |
| 326 | BigInteger t = BigIntegerFromInt(0); | 313 | BigInteger t = BigIntegerFromInt(0); |
| 327 | char * p = dest; | 314 | char * p = dest; |
| @@ -345,8 +332,7 @@ BigIntegerToString(src, dest, destlen, radix) | |||
| 345 | } | 332 | } |
| 346 | 333 | ||
| 347 | int | 334 | int |
| 348 | BigIntegerBitLen(b) | 335 | BigIntegerBitLen(BigInteger b) |
| 349 | BigInteger b; | ||
| 350 | { | 336 | { |
| 351 | #ifdef OPENSSL | 337 | #ifdef OPENSSL |
| 352 | return BN_num_bits(b); | 338 | return BN_num_bits(b); |
| @@ -364,8 +350,7 @@ BigIntegerBitLen(b) | |||
| 364 | } | 350 | } |
| 365 | 351 | ||
| 366 | int | 352 | int |
| 367 | BigIntegerCmp(c1, c2) | 353 | BigIntegerCmp(BigInteger c1, BigInteger c2) |
| 368 | BigInteger c1, c2; | ||
| 369 | { | 354 | { |
| 370 | #ifdef OPENSSL | 355 | #ifdef OPENSSL |
| 371 | return BN_cmp(c1, c2); | 356 | return BN_cmp(c1, c2); |
| @@ -383,9 +368,7 @@ BigIntegerCmp(c1, c2) | |||
| 383 | } | 368 | } |
| 384 | 369 | ||
| 385 | int | 370 | int |
| 386 | BigIntegerCmpInt(c1, c2) | 371 | BigIntegerCmpInt(BigInteger c1, unsigned int c2) |
| 387 | BigInteger c1; | ||
| 388 | unsigned int c2; | ||
| 389 | { | 372 | { |
| 390 | #ifdef OPENSSL | 373 | #ifdef OPENSSL |
| 391 | BigInteger bc2 = BigIntegerFromInt(c2); | 374 | BigInteger bc2 = BigIntegerFromInt(c2); |
| @@ -414,9 +397,7 @@ BigIntegerCmpInt(c1, c2) | |||
| 414 | } | 397 | } |
| 415 | 398 | ||
| 416 | BigIntegerResult | 399 | BigIntegerResult |
| 417 | BigIntegerLShift(result, x, bits) | 400 | BigIntegerLShift(BigInteger result, BigInteger x, unsigned int bits) |
| 418 | BigInteger result, x; | ||
| 419 | unsigned int bits; | ||
| 420 | { | 401 | { |
| 421 | #ifdef OPENSSL | 402 | #ifdef OPENSSL |
| 422 | BN_lshift(result, x, bits); | 403 | BN_lshift(result, x, bits); |
| @@ -436,8 +417,7 @@ BigIntegerLShift(result, x, bits) | |||
| 436 | } | 417 | } |
| 437 | 418 | ||
| 438 | BigIntegerResult | 419 | BigIntegerResult |
| 439 | BigIntegerAdd(result, a1, a2) | 420 | BigIntegerAdd(BigInteger result, BigInteger a1, BigInteger a2) |
| 440 | BigInteger result, a1, a2; | ||
| 441 | { | 421 | { |
| 442 | #ifdef OPENSSL | 422 | #ifdef OPENSSL |
| 443 | BN_add(result, a1, a2); | 423 | BN_add(result, a1, a2); |
| @@ -456,9 +436,7 @@ BigIntegerAdd(result, a1, a2) | |||
| 456 | } | 436 | } |
| 457 | 437 | ||
| 458 | BigIntegerResult | 438 | BigIntegerResult |
| 459 | BigIntegerAddInt(result, a1, a2) | 439 | BigIntegerAddInt(BigInteger result, BigInteger a1, unsigned int a2) |
| 460 | BigInteger result, a1; | ||
| 461 | unsigned int a2; | ||
| 462 | { | 440 | { |
| 463 | #ifdef OPENSSL | 441 | #ifdef OPENSSL |
| 464 | if(result != a1) | 442 | if(result != a1) |
| @@ -483,8 +461,7 @@ BigIntegerAddInt(result, a1, a2) | |||
| 483 | } | 461 | } |
| 484 | 462 | ||
| 485 | BigIntegerResult | 463 | BigIntegerResult |
| 486 | BigIntegerSub(result, s1, s2) | 464 | BigIntegerSub(BigInteger result, BigInteger s1, BigInteger s2) |
| 487 | BigInteger result, s1, s2; | ||
| 488 | { | 465 | { |
| 489 | #ifdef OPENSSL | 466 | #ifdef OPENSSL |
| 490 | BN_sub(result, s1, s2); | 467 | BN_sub(result, s1, s2); |
| @@ -503,9 +480,7 @@ BigIntegerSub(result, s1, s2) | |||
| 503 | } | 480 | } |
| 504 | 481 | ||
| 505 | BigIntegerResult | 482 | BigIntegerResult |
| 506 | BigIntegerSubInt(result, s1, s2) | 483 | BigIntegerSubInt(BigInteger result, BigInteger s1, unsigned int s2) |
| 507 | BigInteger result, s1; | ||
| 508 | unsigned int s2; | ||
| 509 | { | 484 | { |
| 510 | #ifdef OPENSSL | 485 | #ifdef OPENSSL |
| 511 | if(result != s1) | 486 | if(result != s1) |
| @@ -530,9 +505,7 @@ BigIntegerSubInt(result, s1, s2) | |||
| 530 | } | 505 | } |
| 531 | 506 | ||
| 532 | BigIntegerResult | 507 | BigIntegerResult |
| 533 | BigIntegerMul(result, m1, m2, c) | 508 | BigIntegerMul(BigInteger result, BigInteger m1, BigInteger m2, BigIntegerCtx c) |
| 534 | BigInteger result, m1, m2; | ||
| 535 | BigIntegerCtx c; | ||
| 536 | { | 509 | { |
| 537 | #ifdef OPENSSL | 510 | #ifdef OPENSSL |
| 538 | BN_CTX * ctx = NULL; | 511 | BN_CTX * ctx = NULL; |
| @@ -556,10 +529,7 @@ BigIntegerMul(result, m1, m2, c) | |||
| 556 | } | 529 | } |
| 557 | 530 | ||
| 558 | BigIntegerResult | 531 | BigIntegerResult |
| 559 | BigIntegerMulInt(result, m1, m2, c) | 532 | BigIntegerMulInt(BigInteger result, BigInteger m1, unsigned int m2, BigIntegerCtx c) |
| 560 | BigInteger result, m1; | ||
| 561 | unsigned int m2; | ||
| 562 | BigIntegerCtx c; | ||
| 563 | { | 533 | { |
| 564 | #ifdef OPENSSL | 534 | #ifdef OPENSSL |
| 565 | if(result != m1) | 535 | if(result != m1) |
| @@ -584,10 +554,7 @@ BigIntegerMulInt(result, m1, m2, c) | |||
| 584 | } | 554 | } |
| 585 | 555 | ||
| 586 | BigIntegerResult | 556 | BigIntegerResult |
| 587 | BigIntegerDivInt(result, d, m, c) | 557 | BigIntegerDivInt(BigInteger result, BigInteger d, unsigned int m, BigIntegerCtx c) |
| 588 | BigInteger result, d; | ||
| 589 | unsigned int m; | ||
| 590 | BigIntegerCtx c; | ||
| 591 | { | 558 | { |
| 592 | #ifdef OPENSSL | 559 | #ifdef OPENSSL |
| 593 | if(result != d) | 560 | if(result != d) |
| @@ -624,9 +591,7 @@ BigIntegerDivInt(result, d, m, c) | |||
| 624 | } | 591 | } |
| 625 | 592 | ||
| 626 | BigIntegerResult | 593 | BigIntegerResult |
| 627 | BigIntegerMod(result, d, m, c) | 594 | BigIntegerMod(BigInteger result, BigInteger d, BigInteger m, BigIntegerCtx c) |
| 628 | BigInteger result, d, m; | ||
| 629 | BigIntegerCtx c; | ||
| 630 | { | 595 | { |
| 631 | #ifdef OPENSSL | 596 | #ifdef OPENSSL |
| 632 | BN_CTX * ctx = NULL; | 597 | BN_CTX * ctx = NULL; |
| @@ -650,10 +615,7 @@ BigIntegerMod(result, d, m, c) | |||
| 650 | } | 615 | } |
| 651 | 616 | ||
| 652 | unsigned int | 617 | unsigned int |
| 653 | BigIntegerModInt(d, m, c) | 618 | BigIntegerModInt(BigInteger d, unsigned int m, BigIntegerCtx c) |
| 654 | BigInteger d; | ||
| 655 | unsigned int m; | ||
| 656 | BigIntegerCtx c; | ||
| 657 | { | 619 | { |
| 658 | #ifdef OPENSSL | 620 | #ifdef OPENSSL |
| 659 | return BN_mod_word(d, m); | 621 | return BN_mod_word(d, m); |
| @@ -711,9 +673,7 @@ BigIntegerModInt(d, m, c) | |||
| 711 | } | 673 | } |
| 712 | 674 | ||
| 713 | BigIntegerResult | 675 | BigIntegerResult |
| 714 | BigIntegerModMul(r, m1, m2, modulus, c) | 676 | BigIntegerModMul(BigInteger r, BigInteger m1, BigInteger m2, BigInteger modulus, BigIntegerCtx c) |
| 715 | BigInteger r, m1, m2, modulus; | ||
| 716 | BigIntegerCtx c; | ||
| 717 | { | 677 | { |
| 718 | #ifdef OPENSSL | 678 | #ifdef OPENSSL |
| 719 | BN_CTX * ctx = NULL; | 679 | BN_CTX * ctx = NULL; |
| @@ -743,10 +703,7 @@ BigIntegerModMul(r, m1, m2, modulus, c) | |||
| 743 | } | 703 | } |
| 744 | 704 | ||
| 745 | BigIntegerResult | 705 | BigIntegerResult |
| 746 | BigIntegerModExp(r, b, e, m, c, a) | 706 | BigIntegerModExp(BigInteger r, BigInteger b, BigInteger e, BigInteger m, BigIntegerCtx c, BigIntegerModAccel a) |
| 747 | BigInteger r, b, e, m; | ||
| 748 | BigIntegerCtx c; | ||
| 749 | BigIntegerModAccel a; | ||
| 750 | { | 707 | { |
| 751 | #ifdef OPENSSL | 708 | #ifdef OPENSSL |
| 752 | #if OPENSSL_VERSION_NUMBER >= 0x00906000 | 709 | #if OPENSSL_VERSION_NUMBER >= 0x00906000 |
| @@ -793,9 +750,7 @@ int _mbedtls_f_rng(void* unused, unsigned char *buf, size_t size) | |||
| 793 | #endif | 750 | #endif |
| 794 | 751 | ||
| 795 | int | 752 | int |
| 796 | BigIntegerCheckPrime(n, c) | 753 | BigIntegerCheckPrime(BigInteger n, BigIntegerCtx c) |
| 797 | BigInteger n; | ||
| 798 | BigIntegerCtx c; | ||
| 799 | { | 754 | { |
| 800 | #ifdef OPENSSL | 755 | #ifdef OPENSSL |
| 801 | int rv; | 756 | int rv; |
| @@ -846,8 +801,7 @@ BigIntegerCheckPrime(n, c) | |||
| 846 | } | 801 | } |
| 847 | 802 | ||
| 848 | BigIntegerResult | 803 | BigIntegerResult |
| 849 | BigIntegerFree(b) | 804 | BigIntegerFree(BigInteger b) |
| 850 | BigInteger b; | ||
| 851 | { | 805 | { |
| 852 | #ifdef OPENSSL | 806 | #ifdef OPENSSL |
| 853 | BN_free(b); | 807 | BN_free(b); |
| @@ -869,8 +823,7 @@ BigIntegerFree(b) | |||
| 869 | } | 823 | } |
| 870 | 824 | ||
| 871 | BigIntegerResult | 825 | BigIntegerResult |
| 872 | BigIntegerClearFree(b) | 826 | BigIntegerClearFree(BigInteger b) |
| 873 | BigInteger b; | ||
| 874 | { | 827 | { |
| 875 | #ifdef OPENSSL | 828 | #ifdef OPENSSL |
| 876 | BN_clear_free(b); | 829 | BN_clear_free(b); |
| @@ -906,8 +859,7 @@ BigIntegerCtxNew() | |||
| 906 | } | 859 | } |
| 907 | 860 | ||
| 908 | BigIntegerResult | 861 | BigIntegerResult |
| 909 | BigIntegerCtxFree(ctx) | 862 | BigIntegerCtxFree(BigIntegerCtx ctx) |
| 910 | BigIntegerCtx ctx; | ||
| 911 | { | 863 | { |
| 912 | #ifdef OPENSSL | 864 | #ifdef OPENSSL |
| 913 | if(ctx) | 865 | if(ctx) |
| @@ -917,9 +869,7 @@ BigIntegerCtxFree(ctx) | |||
| 917 | } | 869 | } |
| 918 | 870 | ||
| 919 | BigIntegerModAccel | 871 | BigIntegerModAccel |
| 920 | BigIntegerModAccelNew(m, c) | 872 | BigIntegerModAccelNew(BigInteger m, BigIntegerCtx c) |
| 921 | BigInteger m; | ||
| 922 | BigIntegerCtx c; | ||
| 923 | { | 873 | { |
| 924 | #ifdef OPENSSL | 874 | #ifdef OPENSSL |
| 925 | BN_CTX * ctx = NULL; | 875 | BN_CTX * ctx = NULL; |
| @@ -939,8 +889,7 @@ BigIntegerModAccelNew(m, c) | |||
| 939 | } | 889 | } |
| 940 | 890 | ||
| 941 | BigIntegerResult | 891 | BigIntegerResult |
| 942 | BigIntegerModAccelFree(accel) | 892 | BigIntegerModAccelFree(BigIntegerModAccel accel) |
| 943 | BigIntegerModAccel accel; | ||
| 944 | { | 893 | { |
| 945 | #ifdef OPENSSL | 894 | #ifdef OPENSSL |
| 946 | if(accel) | 895 | if(accel) |
diff --git a/3rd_party/libsrp6a-sha512/t_misc.c b/3rd_party/libsrp6a-sha512/t_misc.c index 3053358..3a2cda1 100644 --- a/3rd_party/libsrp6a-sha512/t_misc.c +++ b/3rd_party/libsrp6a-sha512/t_misc.c | |||
| @@ -80,8 +80,7 @@ SHA1_CTX randctxt; | |||
| 80 | extern char ** environ; | 80 | extern char ** environ; |
| 81 | 81 | ||
| 82 | static void | 82 | static void |
| 83 | t_envhash(out) | 83 | t_envhash(unsigned char * out) |
| 84 | unsigned char * out; | ||
| 85 | { | 84 | { |
| 86 | char ** ptr; | 85 | char ** ptr; |
| 87 | char ebuf[256]; | 86 | char ebuf[256]; |
| @@ -115,8 +114,7 @@ t_envhash(out) | |||
| 115 | * The entire buffer is run once through SHA to obtain the final result. | 114 | * The entire buffer is run once through SHA to obtain the final result. |
| 116 | */ | 115 | */ |
| 117 | static void | 116 | static void |
| 118 | t_fshash(out) | 117 | t_fshash(unsigned char * out) |
| 119 | unsigned char * out; | ||
| 120 | { | 118 | { |
| 121 | char dotpath[128]; | 119 | char dotpath[128]; |
| 122 | struct stat st; | 120 | struct stat st; |
| @@ -317,9 +315,7 @@ t_stronginitrand() | |||
| 317 | * Each cycle generates 20 bytes of new output. | 315 | * Each cycle generates 20 bytes of new output. |
| 318 | */ | 316 | */ |
| 319 | _TYPE( void ) | 317 | _TYPE( void ) |
| 320 | t_random(data, size) | 318 | t_random(unsigned char * data, unsigned size) |
| 321 | unsigned char * data; | ||
| 322 | unsigned size; | ||
| 323 | { | 319 | { |
| 324 | if(!initialized) | 320 | if(!initialized) |
| 325 | t_initrand(); | 321 | t_initrand(); |
| @@ -369,10 +365,7 @@ t_random(data, size) | |||
| 369 | * single 320-bit value. | 365 | * single 320-bit value. |
| 370 | */ | 366 | */ |
| 371 | _TYPE( unsigned char * ) | 367 | _TYPE( unsigned char * ) |
| 372 | t_sessionkey(key, sk, sklen) | 368 | t_sessionkey(unsigned char * key, unsigned char * sk, unsigned sklen) |
| 373 | unsigned char * key; | ||
| 374 | unsigned char * sk; | ||
| 375 | unsigned sklen; | ||
| 376 | { | 369 | { |
| 377 | unsigned i, klen; | 370 | unsigned i, klen; |
| 378 | unsigned char * hbuf; | 371 | unsigned char * hbuf; |
| @@ -411,11 +404,7 @@ t_sessionkey(key, sk, sklen) | |||
| 411 | } | 404 | } |
| 412 | 405 | ||
| 413 | _TYPE( void ) | 406 | _TYPE( void ) |
| 414 | t_mgf1(mask, masklen, seed, seedlen) | 407 | t_mgf1(unsigned char * mask, unsigned masklen, const unsigned char * seed, unsigned seedlen) |
| 415 | unsigned char * mask; | ||
| 416 | unsigned masklen; | ||
| 417 | const unsigned char * seed; | ||
| 418 | unsigned seedlen; | ||
| 419 | { | 408 | { |
| 420 | SHA1_CTX ctxt; | 409 | SHA1_CTX ctxt; |
| 421 | unsigned i = 0; | 410 | unsigned i = 0; |
diff --git a/3rd_party/libsrp6a-sha512/t_truerand.c b/3rd_party/libsrp6a-sha512/t_truerand.c index 4a4c3d2..f995ed7 100644 --- a/3rd_party/libsrp6a-sha512/t_truerand.c +++ b/3rd_party/libsrp6a-sha512/t_truerand.c | |||
| @@ -227,8 +227,7 @@ raw_truerand() | |||
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | int | 229 | int |
| 230 | raw_n_truerand(n) | 230 | raw_n_truerand(int n) |
| 231 | int n; | ||
| 232 | { | 231 | { |
| 233 | int slop, v; | 232 | int slop, v; |
| 234 | 233 | ||
