diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/evp/encode.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/encode.c b/src/lib/libcrypto/evp/encode.c index 95dc79d70d..2f942a032f 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.27 2020/03/03 15:03:14 inoguchi Exp $ */ | 1 | /* $OpenBSD: encode.c,v 1.28 2020/03/04 11:53:21 inoguchi 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 | * |
| @@ -62,8 +62,8 @@ | |||
| 62 | 62 | ||
| 63 | #include <openssl/evp.h> | 63 | #include <openssl/evp.h> |
| 64 | 64 | ||
| 65 | static unsigned char conv_ascii2bin(unsigned char a); | ||
| 65 | #define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) | 66 | #define conv_bin2ascii(a) (data_bin2ascii[(a)&0x3f]) |
| 66 | #define conv_ascii2bin(a) (data_ascii2bin[(a)&0x7f]) | ||
| 67 | 67 | ||
| 68 | /* 64 char lines | 68 | /* 64 char lines |
| 69 | * pad input with 0 | 69 | * pad input with 0 |
| @@ -113,6 +113,14 @@ static const unsigned char data_ascii2bin[128] = { | |||
| 113 | 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, | 113 | 0x31, 0x32, 0x33, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, |
| 114 | }; | 114 | }; |
| 115 | 115 | ||
| 116 | static unsigned char | ||
| 117 | conv_ascii2bin(unsigned char a) | ||
| 118 | { | ||
| 119 | if (a & 0x80) | ||
| 120 | return B64_ERROR; | ||
| 121 | return data_ascii2bin[a]; | ||
| 122 | } | ||
| 123 | |||
| 116 | EVP_ENCODE_CTX * | 124 | EVP_ENCODE_CTX * |
| 117 | EVP_ENCODE_CTX_new(void) | 125 | EVP_ENCODE_CTX_new(void) |
| 118 | { | 126 | { |
