diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2016-04-15 13:34:56 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2016-04-15 13:34:56 +0200 |
commit | fa05d4cd2867e856311330f5e647819e7a1312a3 (patch) | |
tree | a7214ef78d3ae5c21c3da7d98131af41383364c4 /vchat-ssl.c | |
parent | 035058400069cd8f3c10213c1c4049746ac9133c (diff) |
More fixes to fingerprint checker code
Diffstat (limited to 'vchat-ssl.c')
-rwxr-xr-x | vchat-ssl.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/vchat-ssl.c b/vchat-ssl.c index 6699243..e584f6c 100755 --- a/vchat-ssl.c +++ b/vchat-ssl.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <stdio.h> | 18 | #include <stdio.h> |
19 | #include <stdlib.h> | 19 | #include <stdlib.h> |
20 | #include <string.h> | 20 | #include <string.h> |
21 | #include <assert.h> | ||
21 | 22 | ||
22 | #include <openssl/err.h> | 23 | #include <openssl/err.h> |
23 | #include <openssl/ssl.h> | 24 | #include <openssl/ssl.h> |
@@ -219,7 +220,7 @@ int vc_connect_ssl( BIO **conn, vc_x509store_t *vc_store ) | |||
219 | int j; | 220 | int j; |
220 | assert ( ( fingerprint_len > 1 ) && (fingerprint_len * 3 < TMPSTRSIZE )); | 221 | assert ( ( fingerprint_len > 1 ) && (fingerprint_len * 3 < TMPSTRSIZE )); |
221 | char * nf = new_fingerprint; | 222 | char * nf = new_fingerprint; |
222 | for (j=0; j<(int)fingerprint_len; j++) { | 223 | for (j=0; j<(int)fingerprint_len; j++) |
223 | nf += snprintf(nf, 3, "%02X:", fingerprint_bin[j]); | 224 | nf += snprintf(nf, 3, "%02X:", fingerprint_bin[j]); |
224 | assert ( nf > new_fingerprint ); | 225 | assert ( nf > new_fingerprint ); |
225 | nf[-1] = 0; | 226 | nf[-1] = 0; |
@@ -232,7 +233,7 @@ int vc_connect_ssl( BIO **conn, vc_x509store_t *vc_store ) | |||
232 | 233 | ||
233 | fingerprint_file = fopen(tilde_expand(getstroption(CF_FINGERPRINT)), "r"); | 234 | fingerprint_file = fopen(tilde_expand(getstroption(CF_FINGERPRINT)), "r"); |
234 | if (fingerprint_file) { | 235 | if (fingerprint_file) { |
235 | int r = fgets(old_fingerprint, TMPSTRSIZE, fingerprint_file); | 236 | char * r = fgets(old_fingerprint, TMPSTRSIZE, fingerprint_file); |
236 | fclose(fingerprint_file); | 237 | fclose(fingerprint_file); |
237 | 238 | ||
238 | /* verify fingerprint matches stored version */ | 239 | /* verify fingerprint matches stored version */ |