Browse code

Remove unneeded wrapper functions in crypto_openssl.c

Both EVPCipherInit_ov() and EVPCipherUpdate_ov() wrapped OpenSSL functions
without any changes, so lets just use the functions directly.

Signed-off-by: Steffan Karger <steffan@karger.me>
Acked-by: Gert Doering <gert@greenie.muc.de>
Message-Id: <1401045501-12343-3-git-send-email-steffan@karger.me>
Signed-off-by: Gert Doering <gert@greenie.muc.de>

Steffan Karger authored on 2014/05/26 04:18:20
Showing 1 changed files
... ...
@@ -57,18 +57,6 @@
57 57
 #warning Some OpenSSL HMAC message digests now support key lengths greater than MAX_HMAC_KEY_LENGTH -- consider increasing MAX_HMAC_KEY_LENGTH
58 58
 #endif
59 59
 
60
-static inline int
61
-EVP_CipherInit_ov (EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, uint8_t *key, uint8_t *iv, int enc)
62
-{
63
-  return EVP_CipherInit (ctx, type, key, iv, enc);
64
-}
65
-
66
-static inline int
67
-EVP_CipherUpdate_ov (EVP_CIPHER_CTX *ctx, uint8_t *out, int *outl, uint8_t *in, int inl)
68
-{
69
-  return EVP_CipherUpdate (ctx, out, outl, in, inl);
70
-}
71
-
72 60
 #ifndef EVP_CIPHER_name
73 61
 #define EVP_CIPHER_name(e)		OBJ_nid2sn(EVP_CIPHER_nid(e))
74 62
 #endif
... ...
@@ -519,13 +507,13 @@ cipher_ctx_init (EVP_CIPHER_CTX *ctx, uint8_t *key, int key_len,
519 519
   CLEAR (*ctx);
520 520
 
521 521
   EVP_CIPHER_CTX_init (ctx);
522
-  if (!EVP_CipherInit_ov (ctx, kt, NULL, NULL, enc))
522
+  if (!EVP_CipherInit (ctx, kt, NULL, NULL, enc))
523 523
     msg (M_SSLERR, "EVP cipher init #1");
524 524
 #ifdef HAVE_EVP_CIPHER_CTX_SET_KEY_LENGTH
525 525
   if (!EVP_CIPHER_CTX_set_key_length (ctx, key_len))
526 526
     msg (M_SSLERR, "EVP set key size");
527 527
 #endif
528
-  if (!EVP_CipherInit_ov (ctx, NULL, key, NULL, enc))
528
+  if (!EVP_CipherInit (ctx, NULL, key, NULL, enc))
529 529
     msg (M_SSLERR, "EVP cipher init #2");
530 530
 
531 531
   /* make sure we used a big enough key */
... ...
@@ -559,14 +547,14 @@ cipher_ctx_mode (const EVP_CIPHER_CTX *ctx)
559 559
 int
560 560
 cipher_ctx_reset (EVP_CIPHER_CTX *ctx, uint8_t *iv_buf)
561 561
 {
562
-  return EVP_CipherInit_ov (ctx, NULL, NULL, iv_buf, -1);
562
+  return EVP_CipherInit (ctx, NULL, NULL, iv_buf, -1);
563 563
 }
564 564
 
565 565
 int
566 566
 cipher_ctx_update (EVP_CIPHER_CTX *ctx, uint8_t *dst, int *dst_len,
567 567
     uint8_t *src, int src_len)
568 568
 {
569
-  return EVP_CipherUpdate_ov (ctx, dst, dst_len, src, src_len);
569
+  return EVP_CipherUpdate (ctx, dst, dst_len, src, src_len);
570 570
 }
571 571
 
572 572
 int