mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
Const-correctness in the base64 functions.
This commit is contained in:
parent
4d88fe3dde
commit
f274b56a57
4
misc.c
4
misc.c
@ -495,7 +495,7 @@ char *chomp(char *str)
|
||||
* Core base64 encoding and decoding routines.
|
||||
*/
|
||||
|
||||
void base64_encode_atom(unsigned char *data, int n, char *out)
|
||||
void base64_encode_atom(const unsigned char *data, int n, char *out)
|
||||
{
|
||||
static const char base64_chars[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
@ -519,7 +519,7 @@ void base64_encode_atom(unsigned char *data, int n, char *out)
|
||||
out[3] = '=';
|
||||
}
|
||||
|
||||
int base64_decode_atom(char *atom, unsigned char *out)
|
||||
int base64_decode_atom(const char *atom, unsigned char *out)
|
||||
{
|
||||
int vals[4];
|
||||
int i, v, len;
|
||||
|
4
misc.h
4
misc.h
@ -44,8 +44,8 @@ int toint(unsigned);
|
||||
char *fgetline(FILE *fp);
|
||||
char *chomp(char *str);
|
||||
|
||||
void base64_encode_atom(unsigned char *data, int n, char *out);
|
||||
int base64_decode_atom(char *atom, unsigned char *out);
|
||||
void base64_encode_atom(const unsigned char *data, int n, char *out);
|
||||
int base64_decode_atom(const char *atom, unsigned char *out);
|
||||
|
||||
struct bufchain_granule;
|
||||
typedef struct bufchain_tag {
|
||||
|
7
ssh.h
7
ssh.h
@ -651,10 +651,11 @@ int rsakey_pubblob(const Filename *filename, void **blob, int *bloblen,
|
||||
|
||||
int saversakey(const Filename *filename, struct RSAKey *key, char *passphrase);
|
||||
|
||||
extern int base64_decode_atom(char *atom, unsigned char *out);
|
||||
extern int base64_decode_atom(const char *atom, unsigned char *out);
|
||||
extern int base64_lines(int datalen);
|
||||
extern void base64_encode_atom(unsigned char *data, int n, char *out);
|
||||
extern void base64_encode(FILE *fp, unsigned char *data, int datalen, int cpl);
|
||||
extern void base64_encode_atom(const unsigned char *data, int n, char *out);
|
||||
extern void base64_encode(FILE *fp, const unsigned char *data, int datalen,
|
||||
int cpl);
|
||||
|
||||
/* ssh2_load_userkey can return this as an error */
|
||||
extern struct ssh2_userkey ssh2_wrong_passphrase;
|
||||
|
Loading…
Reference in New Issue
Block a user