Fossil

Check-in [693ab93b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:replaced two C++-style comments.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 693ab93b7de85e9d6ff68f01da10914f982ce3c0
User & Date: stephan 2011-09-16 18:53:36
References
2011-09-16
18:57
Merged trunk [693ab93b7d] to quiet down -Wall. Removed a trailing comma from an enum (-Wall mode). check-in: 98cdd410 user: stephan tags: json
Context
2011-09-16
19:48
Update the built-in SQLite amalgamation to the latest 3.7.8 beta. check-in: 4db5bd11 user: drh tags: trunk
18:57
Merged trunk [693ab93b7d] to quiet down -Wall. Removed a trailing comma from an enum (-Wall mode). check-in: 98cdd410 user: stephan tags: json
18:53
replaced two C++-style comments. check-in: 693ab93b user: stephan tags: trunk
11:19
minor typo and wiki formatting fix. Added another external link. check-in: 9f5c40cb user: stephan tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/http_ssl.c.

247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
    BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n ");
    if(X509_digest(cert, EVP_sha1(), md, &mdLength)){
      int j;
      for( j = 0; j < mdLength; ++j ) {
        BIO_printf(mem, " %02x", md[j]);
      }
    }
    BIO_write(mem, "", 1); // null-terminate mem buffer
    BIO_get_mem_data(mem, &desc);
    
    if( hasSavedCertificate ){
      warning = "WARNING: Certificate doesn't match the "
                "saved certificate for this host!";
    }
    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
................................................................................
*/
void ssl_save_certificate(X509 *cert){
  BIO *mem;
  char *zCert, *zHost;

  mem = BIO_new(BIO_s_mem());
  PEM_write_bio_X509(mem, cert);
  BIO_write(mem, "", 1); // null-terminate mem buffer
  BIO_get_mem_data(mem, &zCert);
  zHost = mprintf("cert:%s", g.urlName);
  db_set(zHost, zCert, 1);
  free(zHost);
  BIO_free(mem);  
}








|







 







|







247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
...
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
    BIO_puts(mem, "\n\nSHA1 Fingerprint:\n\n ");
    if(X509_digest(cert, EVP_sha1(), md, &mdLength)){
      int j;
      for( j = 0; j < mdLength; ++j ) {
        BIO_printf(mem, " %02x", md[j]);
      }
    }
    BIO_write(mem, "", 1); /* nul-terminate mem buffer */
    BIO_get_mem_data(mem, &desc);
    
    if( hasSavedCertificate ){
      warning = "WARNING: Certificate doesn't match the "
                "saved certificate for this host!";
    }
    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
................................................................................
*/
void ssl_save_certificate(X509 *cert){
  BIO *mem;
  char *zCert, *zHost;

  mem = BIO_new(BIO_s_mem());
  PEM_write_bio_X509(mem, cert);
  BIO_write(mem, "", 1); /* nul-terminate mem buffer */
  BIO_get_mem_data(mem, &zCert);
  zHost = mprintf("cert:%s", g.urlName);
  db_set(zHost, zCert, 1);
  free(zHost);
  BIO_free(mem);  
}