diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-01-09 11:50:34 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-01-09 11:50:34 +0000 |
commit | a15133f5cf8ea20f623c49e829d4a0a519913b39 (patch) | |
tree | 5a9f6c35a1200890de3d856f7d91eb8819bc7fcd | |
parent | cc09e9d4c29782c7421bba0062793f2140f7ad15 (diff) |
removed unused code
-rw-r--r-- | lib/security.c | 76 |
1 files changed, 2 insertions, 74 deletions
diff --git a/lib/security.c b/lib/security.c index 653772ab3..c8add6991 100644 --- a/lib/security.c +++ b/lib/security.c @@ -279,32 +279,6 @@ Curl_sec_write(struct connectdata *conn, int fd, char *buffer, int length) } int -Curl_sec_vfprintf2(struct connectdata *conn, FILE *f, const char *fmt, va_list ap) -{ - char *buf; - int ret; - if(conn->data_prot == prot_clear) - return vfprintf(f, fmt, ap); - else { - buf = aprintf(fmt, ap); - ret = buffer_write(&conn->out_buffer, buf, strlen(buf)); - free(buf); - return ret; - } -} - -int -Curl_sec_fprintf2(struct connectdata *conn, FILE *f, const char *fmt, ...) -{ - int ret; - va_list ap; - va_start(ap, fmt); - ret = Curl_sec_vfprintf2(conn, f, fmt, ap); - va_end(ap); - return ret; -} - -int Curl_sec_putc(struct connectdata *conn, int c, FILE *F) { char ch = c; @@ -313,7 +287,8 @@ Curl_sec_putc(struct connectdata *conn, int c, FILE *F) buffer_write(&conn->out_buffer, &ch, 1); if(c == '\n' || conn->out_buffer.index >= 1024 /* XXX */) { - Curl_sec_write(conn, fileno(F), conn->out_buffer.data, conn->out_buffer.index); + Curl_sec_write(conn, fileno(F), conn->out_buffer.data, + conn->out_buffer.index); conn->out_buffer.index = 0; } return c; @@ -346,53 +321,6 @@ Curl_sec_read_msg(struct connectdata *conn, char *s, int level) return code; } -/* modified to return how many bytes written, or -1 on error ***/ -int -Curl_sec_vfprintf(struct connectdata *conn, FILE *f, const char *fmt, va_list ap) -{ - int ret = 0; - char *buf; - void *enc; - int len; - if(!conn->sec_complete) - return vfprintf(f, fmt, ap); - - buf = aprintf(fmt, ap); - len = (conn->mech->encode)(conn->app_data, buf, strlen(buf), - conn->command_prot, &enc, - conn); - free(buf); - if(len < 0) { - failf(conn->data, "Failed to encode command."); - return -1; - } - if(Curl_base64_encode(enc, len, &buf) < 0){ - failf(conn->data, "Out of memory base64-encoding."); - return -1; - } - if(conn->command_prot == prot_safe) - ret = fprintf(f, "MIC %s", buf); - else if(conn->command_prot == prot_private) - ret = fprintf(f, "ENC %s", buf); - else if(conn->command_prot == prot_confidential) - ret = fprintf(f, "CONF %s", buf); - - free(buf); - return ret; -} - -int -Curl_sec_fprintf(struct connectdata *conn, FILE *f, const char *fmt, ...) -{ - va_list ap; - int ret; - va_start(ap, fmt); - ret = Curl_sec_vfprintf(conn, f, fmt, ap); - va_end(ap); - return ret; -} - - enum protection_level Curl_set_command_prot(struct connectdata *conn, enum protection_level level) { |