Beispiel #1
0
void sln_hmac_openssl_destroy(sln_hmac_t *h) {
  selene_t *s = h->s;
  HMAC_CTX *hctx = h->baton;

  HMAC_CTX_cleanup(hctx);

  sln_free(s, hctx);
  sln_free(s, h);
}
void sln_cryptor_osx_cc_destroy(sln_cryptor_t *enc) {
  selene_t *s = enc->s;
  CCCryptorRef cryptor = enc->baton;

  CCCryptorRelease(cryptor);

  sln_free(s, enc);
}
Beispiel #3
0
selene_error_t*
sln_io_alert_read(selene_t *s, sln_parser_baton_t *baton)
{
  sln_alert_baton_t ab;

  ab.s = s;
  ab.baton = baton;
  ab.state = SLN_ALERT_STATE__INIT;
  ab.alert = sln_calloc(s, sizeof(sln_msg_alert_t));

  sln_tok_parser(baton->in_alert, sln_alert_parse, &ab);

  if (ab.state == SLN_ALERT_STATE__DONE) {
    /* TODO: emit event for alert */
    /* TODO: handle close notify */
  }

  sln_free(s, ab.alert);

  return SELENE_SUCCESS;
}