version 1.17.8.1, 2006/10/06 03:19:33 |
version 1.18, 2006/03/19 18:51:19 |
|
|
/* $OpenBSD$ */ |
|
/* |
/* |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
* Copyright (c) 2000 Markus Friedl. All rights reserved. |
* |
* |
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
*/ |
*/ |
|
|
#include <sys/types.h> |
#include "includes.h" |
#include <netinet/in.h> |
|
#include <resolv.h> |
|
#include <stdio.h> |
|
|
|
#include "xmalloc.h" |
#include "xmalloc.h" |
#include "uuencode.h" |
#include "uuencode.h" |
|
|
|
#include <resolv.h> |
|
|
int |
int |
uuencode(const u_char *src, u_int srclength, |
uuencode(const u_char *src, u_int srclength, |
char *target, size_t targsize) |
char *target, size_t targsize) |
|
|
void |
void |
dump_base64(FILE *fp, u_char *data, u_int len) |
dump_base64(FILE *fp, u_char *data, u_int len) |
{ |
{ |
char *buf; |
char *buf = xmalloc(2*len); |
int i, n; |
int i, n; |
|
|
if (len > 65536) { |
|
fprintf(fp, "dump_base64: len > 65536\n"); |
|
return; |
|
} |
|
buf = xmalloc(2*len); |
|
n = uuencode(data, len, buf, 2*len); |
n = uuencode(data, len, buf, 2*len); |
for (i = 0; i < n; i++) { |
for (i = 0; i < n; i++) { |
fprintf(fp, "%c", buf[i]); |
fprintf(fp, "%c", buf[i]); |