diff options
Diffstat (limited to 'src/lib/libcrypto/evp/encode.c')
| -rw-r--r-- | src/lib/libcrypto/evp/encode.c | 35 |
1 files changed, 1 insertions, 34 deletions
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 067e62dfe9..725667bfff 100644 --- a/src/lib/libcrypto/evp/encode.c +++ b/src/lib/libcrypto/evp/encode.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: encode.c,v 1.19 2014/08/06 16:01:44 jsing Exp $ */ | 1 | /* $OpenBSD: encode.c,v 1.20 2015/02/07 13:19:15 doug 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 | * |
| @@ -415,36 +415,3 @@ EVP_DecodeFinal(EVP_ENCODE_CTX *ctx, unsigned char *out, int *outl) | |||
| 415 | } else | 415 | } else |
| 416 | return (1); | 416 | return (1); |
| 417 | } | 417 | } |
| 418 | |||
| 419 | #ifdef undef | ||
| 420 | int | ||
| 421 | EVP_DecodeValid(unsigned char *buf, int len) | ||
| 422 | { | ||
| 423 | int i, num = 0, bad = 0; | ||
| 424 | |||
| 425 | if (len == 0) | ||
| 426 | return (-1); | ||
| 427 | while (conv_ascii2bin(*buf) == B64_WS) { | ||
| 428 | buf++; | ||
| 429 | len--; | ||
| 430 | if (len == 0) | ||
| 431 | return (-1); | ||
| 432 | } | ||
| 433 | |||
| 434 | for (i = len; i >= 4; i -= 4) { | ||
| 435 | if ((conv_ascii2bin(buf[0]) >= 0x40) || | ||
| 436 | (conv_ascii2bin(buf[1]) >= 0x40) || | ||
| 437 | (conv_ascii2bin(buf[2]) >= 0x40) || | ||
| 438 | (conv_ascii2bin(buf[3]) >= 0x40)) | ||
| 439 | return (-1); | ||
| 440 | buf += 4; | ||
| 441 | num += 1 + (buf[2] != '=') + (buf[3] != '='); | ||
| 442 | } | ||
| 443 | if ((i == 1) && (conv_ascii2bin(buf[0]) == B64_EOLN)) | ||
| 444 | return (num); | ||
| 445 | if ((i == 2) && (conv_ascii2bin(buf[0]) == B64_EOLN) && | ||
| 446 | (conv_ascii2bin(buf[0]) == B64_EOLN)) | ||
| 447 | return (num); | ||
| 448 | return (1); | ||
| 449 | } | ||
| 450 | #endif | ||
