Changeset e2cbbbe for functions.c


Ignore:
Timestamp:
Apr 8, 2010, 10:00:41 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.6, release-1.7, release-1.8, release-1.9
Children:
b094191
Parents:
8a5b5a1 (diff), 9a7b4f2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:
Merge branch 'refactor-zcrypt'
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r8a5b5a1 re2cbbbe  
    1212#include <signal.h>
    1313#include "owl.h"
     14#include "filterproc.h"
    1415
    1516char *owl_function_command(const char *cmdbuff)
     
    399400  char *cryptmsg;
    400401  owl_message *m;
     402  const char *argv[7];
     403  char *zcrypt;
     404  int rv, status;
    401405
    402406  /* create the zwrite and send the message */
     
    408412
    409413  mymsg=owl_zwrite_get_message(&z);
    410 #ifdef OWL_ENABLE_ZCRYPT
    411   cryptmsg = owl_zcrypt_encrypt(mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z));
    412   if (!cryptmsg) {
     414
     415  zcrypt = owl_sprintf("%s/zcrypt", owl_get_bindir());
     416  argv[0] = "zcrypt";
     417  argv[1] = "-E";
     418  argv[2] = "-c"; argv[3] = owl_zwrite_get_class(&z);
     419  argv[4] = "-i"; argv[5] = owl_zwrite_get_instance(&z);
     420  argv[6] = NULL;
     421
     422  rv = call_filter(zcrypt, argv, mymsg, &cryptmsg, &status);
     423
     424  owl_free(zcrypt);
     425
     426  if (rv || status) {
     427    if(cryptmsg) owl_free(cryptmsg);
    413428    owl_function_error("Error in zcrypt, possibly no key found.  Message not sent.");
    414429    owl_function_beep();
     
    416431    return;
    417432  }
    418 #else
    419   cryptmsg=owl_strdup(mymsg);
    420 #endif
    421433
    422434  owl_zwrite_set_message(&z, cryptmsg);
Note: See TracChangeset for help on using the changeset viewer.