Rizin
unix-like reverse engineering framework and cli tools
zip_get_encryption_implementation.c File Reference
#include "zipint.h"

Go to the source code of this file.

Functions

zip_encryption_implementation _zip_get_encryption_implementation (zip_uint16_t em, int operation)
 
ZIP_EXTERN int zip_encryption_method_supported (zip_uint16_t method, int encode)
 

Function Documentation

◆ _zip_get_encryption_implementation()

zip_encryption_implementation _zip_get_encryption_implementation ( zip_uint16_t  em,
int  operation 
)

Definition at line 39 of file zip_get_encryption_implementation.c.

39  {
40  switch (em) {
41  case ZIP_EM_TRAD_PKWARE:
43 
44 #if defined(HAVE_CRYPTO)
45  case ZIP_EM_AES_128:
46  case ZIP_EM_AES_192:
47  case ZIP_EM_AES_256:
49 #endif
50 
51  default:
52  return NULL;
53  }
54 }
#define NULL
Definition: cris-opc.c:27
#define ZIP_EM_TRAD_PKWARE
Definition: zip.h:178
#define ZIP_EM_AES_256
Definition: zip.h:192
#define ZIP_EM_AES_192
Definition: zip.h:191
#define ZIP_EM_AES_128
Definition: zip.h:190
zip_source_t * zip_source_pkware_decode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flags, const char *password)
zip_source_t * zip_source_pkware_encode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flags, const char *password)
zip_source_t * zip_source_winzip_aes_decode(zip_t *za, zip_source_t *src, zip_uint16_t encryption_method, int flags, const char *password)
zip_source_t * zip_source_winzip_aes_encode(zip_t *za, zip_source_t *src, zip_uint16_t encryption_method, int flags, const char *password)
#define ZIP_CODEC_DECODE
Definition: zipint.h:107

References NULL, ZIP_CODEC_DECODE, ZIP_EM_AES_128, ZIP_EM_AES_192, ZIP_EM_AES_256, ZIP_EM_TRAD_PKWARE, zip_source_pkware_decode(), zip_source_pkware_encode(), zip_source_winzip_aes_decode(), and zip_source_winzip_aes_encode().

Referenced by _zip_source_zip_new(), add_data(), zip_encryption_method_supported(), and zip_file_set_encryption().

◆ zip_encryption_method_supported()

ZIP_EXTERN int zip_encryption_method_supported ( zip_uint16_t  method,
int  encode 
)

Definition at line 57 of file zip_get_encryption_implementation.c.

57  {
58  if (method == ZIP_EM_NONE) {
59  return 1;
60  }
62 }
static void encode(size_t size, lzma_action action)
Definition: full_flush.c:25
#define ZIP_EM_NONE
Definition: zip.h:177
zip_encryption_implementation _zip_get_encryption_implementation(zip_uint16_t em, int operation)
#define ZIP_CODEC_ENCODE
Definition: zipint.h:108

References _zip_get_encryption_implementation(), encode(), NULL, ZIP_CODEC_DECODE, ZIP_CODEC_ENCODE, and ZIP_EM_NONE.

Referenced by usage().