Changeset d564c3d for functions.c


Ignore:
Timestamp:
Mar 17, 2010, 11:15:36 PM (14 years ago)
Author:
Nelson Elhage <nelhage@ksplice.com>
Branches:
master, release-1.10, release-1.6, release-1.7, release-1.8, release-1.9
Children:
2b7ef0a
Parents:
dfe94f9
git-author:
Nelson Elhage <nelhage@ksplice.com> (03/17/10 22:55:20)
git-committer:
Nelson Elhage <nelhage@ksplice.com> (03/17/10 23:15:36)
Message:
Replace the built-in zcrypt with shelling out to the zcrypt binary.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    rdfe94f9 rd564c3d  
    1212#include <signal.h>
    1313#include "owl.h"
     14#include "filterproc.h"
    1415
    1516char *owl_function_command(const char *cmdbuff)
     
    402403  char *cryptmsg;
    403404  owl_message *m;
     405  const char *argv[7];
     406  int rv, status;
    404407
    405408  /* create the zwrite and send the message */
     
    411414
    412415  mymsg=owl_zwrite_get_message(&z);
    413 #ifdef OWL_ENABLE_ZCRYPT
    414   cryptmsg = owl_zcrypt_encrypt(mymsg, owl_zwrite_get_class(&z), owl_zwrite_get_instance(&z));
    415   if (!cryptmsg) {
     416
     417  argv[0] = "zcrypt";
     418  argv[1] = "-E";
     419  argv[2] = "-c"; argv[3] = owl_zwrite_get_class(&z);
     420  argv[4] = "-i"; argv[5] = owl_zwrite_get_instance(&z);
     421  argv[6] = NULL;
     422
     423  rv = call_filter("zcrypt", argv, mymsg, &cryptmsg, &status);
     424
     425  if (rv || status) {
     426    if(cryptmsg) owl_free(cryptmsg);
    416427    owl_function_error("Error in zcrypt, possibly no key found.  Message not sent.");
    417428    owl_function_beep();
     
    419430    return;
    420431  }
    421 #else
    422   cryptmsg=owl_strdup(mymsg);
    423 #endif
    424432
    425433  owl_zwrite_set_message(&z, cryptmsg);
Note: See TracChangeset for help on using the changeset viewer.