polarssl 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/ext/polarssl/cipher.c +14 -14
- data/lib/polarssl/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3aefd27c4837aa5c16a20f4fdb9ccdf861bca42
|
4
|
+
data.tar.gz: d906ff3c64af979f00c88477a6e692d74c7a8f55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7e47febacb18ce4c6e987abb07ff411492e015f5fe5d781147573ca1d89101582cc6cb0c46e60377ee88007b4427a449da95f6b6afee22ab7374655655dc259
|
7
|
+
data.tar.gz: 57b9a7d1ed9d4e33483e597bf6fc527d9952e4c65599c742da462aceb2d6120e77b795dcc885c0ccc8ceb3f811baaacf9e102d6099f97af1c06090ec5c546bdc
|
data/.travis.yml
CHANGED
data/ext/polarssl/cipher.c
CHANGED
@@ -131,9 +131,9 @@ void Init_cipher(void)
|
|
131
131
|
* Raised when you do not pass a supported cipher type to PolarSSL::Cipher.new()
|
132
132
|
*/
|
133
133
|
e_UnsupportedCipher = rb_define_class_under( cCipher, "UnsupportedCipher", rb_eStandardError );
|
134
|
-
|
134
|
+
|
135
135
|
/* Document-class: PolarSSL::Cipher::BadInputData
|
136
|
-
* Raised when the input data for the cipher was incorrect. If you get
|
136
|
+
* Raised when the input data for the cipher was incorrect. If you get
|
137
137
|
* this exception, please file a bug report.
|
138
138
|
*/
|
139
139
|
e_BadInputData = rb_define_class_under( cCipher, "BadInputData", rb_eStandardError );
|
@@ -180,7 +180,7 @@ VALUE rb_cipher_initialize( VALUE self, VALUE cipher_type )
|
|
180
180
|
char *cipher_type_str;
|
181
181
|
const cipher_info_t *cipher_info;
|
182
182
|
int ret;
|
183
|
-
|
183
|
+
|
184
184
|
Check_Type( cipher_type, T_STRING );
|
185
185
|
|
186
186
|
cipher_type_str = StringValueCStr( cipher_type );
|
@@ -193,7 +193,7 @@ VALUE rb_cipher_initialize( VALUE self, VALUE cipher_type )
|
|
193
193
|
{
|
194
194
|
rb_raise(e_UnsupportedCipher, "%s is not a supported cipher", cipher_type_str );
|
195
195
|
}
|
196
|
-
else
|
196
|
+
else
|
197
197
|
{
|
198
198
|
ret = cipher_init_ctx( rb_cipher->ctx, cipher_info );
|
199
199
|
if ( ret < 0 )
|
@@ -215,25 +215,25 @@ VALUE rb_cipher_initialize( VALUE self, VALUE cipher_type )
|
|
215
215
|
* One option to generate a random initialization vector is by using
|
216
216
|
* SecureRandom.random_bytes. Store this initialization vector with the
|
217
217
|
* ciphertext and you'll easily able to decrypt the ciphertext.
|
218
|
-
*
|
218
|
+
*
|
219
219
|
*/
|
220
220
|
VALUE rb_cipher_reset( VALUE self, VALUE initialization_vector )
|
221
221
|
{
|
222
222
|
rb_cipher_t *rb_cipher;
|
223
223
|
unsigned char *iv;
|
224
224
|
int ret;
|
225
|
-
|
225
|
+
|
226
226
|
Check_Type( initialization_vector, T_STRING );
|
227
|
-
|
228
|
-
iv = (unsigned char *)
|
229
|
-
|
227
|
+
|
228
|
+
iv = (unsigned char *) StringValuePtr( initialization_vector );
|
229
|
+
|
230
230
|
Data_Get_Struct( self, rb_cipher_t, rb_cipher );
|
231
|
-
|
231
|
+
|
232
232
|
ret = cipher_reset( rb_cipher->ctx, iv );
|
233
|
-
|
233
|
+
|
234
234
|
if ( ret < 0 )
|
235
235
|
rb_raise( e_BadInputData, "Either the cipher type, key or initialization vector was not set." );
|
236
|
-
|
236
|
+
|
237
237
|
return Qtrue;
|
238
238
|
}
|
239
239
|
|
@@ -253,7 +253,7 @@ VALUE rb_cipher_setkey( VALUE self, VALUE key, VALUE key_length, VALUE operation
|
|
253
253
|
{
|
254
254
|
rb_cipher_t *rb_cipher;
|
255
255
|
int ret;
|
256
|
-
|
256
|
+
|
257
257
|
Check_Type( key, T_STRING );
|
258
258
|
Check_Type( key_length, T_FIXNUM );
|
259
259
|
Check_Type( operation, T_FIXNUM );
|
@@ -279,7 +279,7 @@ VALUE rb_cipher_update( VALUE self, VALUE rb_input )
|
|
279
279
|
rb_cipher_t *rb_cipher;
|
280
280
|
char *input;
|
281
281
|
int ret;
|
282
|
-
|
282
|
+
|
283
283
|
Check_Type( rb_input, T_STRING );
|
284
284
|
|
285
285
|
Data_Get_Struct( self, rb_cipher_t, rb_cipher );
|
data/lib/polarssl/version.rb
CHANGED