~ubuntu-branches/ubuntu/dapper/ruby1.9/dapper

« back to all changes in this revision

Viewing changes to ext/openssl/ossl_cipher.c

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2006-05-08 22:23:12 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20060508222312-w2wqeaz030ifi59j
Tags: 1.9.0+20060423-3ubuntu1
* Resynchronized with Debian.
* Only change from Debian is the addition of
  debian/patches/903_sparc_fix_define.patch to fix illegal instructions
  at runtime on sparc. (change from 1.9.0+20050921-1ubuntu1)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: ossl_cipher.c,v 1.9 2005/03/04 06:47:38 matz Exp $
 
2
 * $Id: ossl_cipher.c,v 1.10 2005/10/30 20:49:49 gotoyuzo Exp $
3
3
 * 'OpenSSL for Ruby' project
4
4
 * Copyright (C) 2001-2002  Michal Rokos <m.rokos@sh.cvut.cz>
5
5
 * All rights reserved.
224
224
 
225
225
    StringValue(data);
226
226
    in = RSTRING(data)->ptr;
227
 
    in_len = RSTRING(data)->len;
 
227
    if ((in_len = RSTRING(data)->len) == 0)
 
228
        rb_raise(rb_eArgError, "data must not be empty");
228
229
    GetCipher(self, ctx);
229
230
    str = rb_str_new(0, in_len+EVP_CIPHER_CTX_block_size(ctx));
230
231
    if (!EVP_CipherUpdate(ctx, RSTRING(str)->ptr, &out_len, in, in_len))