/mandos/release

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/release

« back to all changes in this revision

Viewing changes to plugins.d/mandos-client.c

  • Committer: Teddy Hogeborn
  • Date: 2018-04-01 19:27:30 UTC
  • mto: (237.7.594 trunk)
  • mto: This revision was merged to the branch mainline in revision 368.
  • Revision ID: teddy@recompile.se-20180401192730-jwr4io5cb3x5u268
Don't print NULL string pointers in error message output

* plugins.d/mandos-client.c (pgp_packet_decrypt): If decryption fails,
  don't print unsupported_algorithm if it is NULL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
  /* Create new GPGME "context" */
357
357
  rc = gpgme_new(&(mc->ctx));
358
358
  if(rc != GPG_ERR_NO_ERROR){
359
 
    fprintf_plus(stderr, "bad gpgme_new: %s: %s\n",
360
 
                 gpgme_strsource(rc), gpgme_strerror(rc));
 
359
    fprintf_plus(stderr, "Mandos plugin mandos-client: "
 
360
                 "bad gpgme_new: %s: %s\n", gpgme_strsource(rc),
 
361
                 gpgme_strerror(rc));
361
362
    return false;
362
363
  }
363
364
  
399
400
  /* Create new empty GPGME data buffer for the plaintext */
400
401
  rc = gpgme_data_new(&dh_plain);
401
402
  if(rc != GPG_ERR_NO_ERROR){
402
 
    fprintf_plus(stderr, "bad gpgme_data_new: %s: %s\n",
 
403
    fprintf_plus(stderr, "Mandos plugin mandos-client: "
 
404
                 "bad gpgme_data_new: %s: %s\n",
403
405
                 gpgme_strsource(rc), gpgme_strerror(rc));
404
406
    gpgme_data_release(dh_crypto);
405
407
    return -1;
422
424
          fprintf_plus(stderr, "Unsupported algorithm: %s\n",
423
425
                       result->unsupported_algorithm);
424
426
        }
425
 
        fprintf_plus(stderr, "Wrong key usage: %s\n",
426
 
                     result->wrong_key_usage ? "Yes" : "No");
 
427
        fprintf_plus(stderr, "Wrong key usage: %u\n",
 
428
                     result->wrong_key_usage);
427
429
        if(result->file_name != NULL){
428
430
          fprintf_plus(stderr, "File name: %s\n", result->file_name);
429
431
        }