Mercurial > dropbear
comparison keyimport.c @ 87:680a0bc9df0a
Some small fixes for unused vars, and old messages
author | Matt Johnston <matt@ucc.asn.au> |
---|---|
date | Tue, 17 Aug 2004 11:14:13 +0000 |
parents | 0bf5cebe622c |
children | c5d3ef11155f |
comparison
equal
deleted
inserted
replaced
86:ace512d2ad5d | 87:680a0bc9df0a |
---|---|
106 } | 106 } |
107 | 107 |
108 static sign_key *dropbear_read(const char* filename) { | 108 static sign_key *dropbear_read(const char* filename) { |
109 | 109 |
110 buffer * buf = NULL; | 110 buffer * buf = NULL; |
111 int len, maxlen; | |
112 FILE *fp = NULL; | |
113 sign_key *ret = NULL; | 111 sign_key *ret = NULL; |
114 int type; | 112 int type; |
115 | 113 |
116 buf = buf_new(MAX_PRIVKEY_SIZE); | 114 buf = buf_new(MAX_PRIVKEY_SIZE); |
117 /* buf_readfile knows about "-" */ | |
118 if (buf_readfile(buf, filename) == DROPBEAR_FAILURE) { | 115 if (buf_readfile(buf, filename) == DROPBEAR_FAILURE) { |
119 goto error; | 116 goto error; |
120 } | 117 } |
121 | 118 |
122 buf_setpos(buf, 0); | 119 buf_setpos(buf, 0); |
161 #endif | 158 #endif |
162 | 159 |
163 buf = buf_new(MAX_PRIVKEY_SIZE); | 160 buf = buf_new(MAX_PRIVKEY_SIZE); |
164 buf_put_priv_key(buf, key, keytype); | 161 buf_put_priv_key(buf, key, keytype); |
165 | 162 |
166 if (strlen(filename) == 1 && filename[0] == '-') { | 163 fp = fopen(filename, "w"); |
167 fp = stdout; | |
168 } else { | |
169 fp = fopen(filename, "w"); | |
170 } | |
171 if (!fp) { | 164 if (!fp) { |
172 ret = 0; | 165 ret = 0; |
173 goto out; | 166 goto out; |
174 } | 167 } |
175 | 168 |