diff options
author | tb <> | 2023-06-11 05:35:43 +0000 |
---|---|---|
committer | tb <> | 2023-06-11 05:35:43 +0000 |
commit | 52c7413490876d8fe7446a40eec79f0a1a74ffc7 (patch) | |
tree | 239565950f7a608fd134cd15de2937288ff47e77 /src/lib/libcrypto/cms/cms_smime.c | |
parent | eb0246e144fe40ea036a24f84618aff44aeec499 (diff) | |
download | openbsd-52c7413490876d8fe7446a40eec79f0a1a74ffc7.tar.gz openbsd-52c7413490876d8fe7446a40eec79f0a1a74ffc7.tar.bz2 openbsd-52c7413490876d8fe7446a40eec79f0a1a74ffc7.zip |
Unifdef ZLIB
This has long been unused code and compilation with -DZLIB was broken
for a long time after BIO was made opaque.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/cms/cms_smime.c')
-rw-r--r-- | src/lib/libcrypto/cms/cms_smime.c | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/src/lib/libcrypto/cms/cms_smime.c b/src/lib/libcrypto/cms/cms_smime.c index d21ff124d7..e9001d0f01 100644 --- a/src/lib/libcrypto/cms/cms_smime.c +++ b/src/lib/libcrypto/cms/cms_smime.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cms_smime.c,v 1.25 2022/11/26 16:08:51 tb Exp $ */ | 1 | /* $OpenBSD: cms_smime.c,v 1.26 2023/06/11 05:35:43 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 3 | * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
4 | * project. | 4 | * project. |
@@ -868,55 +868,6 @@ CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags) | |||
868 | return ret; | 868 | return ret; |
869 | } | 869 | } |
870 | 870 | ||
871 | #ifdef ZLIB | ||
872 | |||
873 | int | ||
874 | CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) | ||
875 | { | ||
876 | BIO *cont; | ||
877 | int r; | ||
878 | |||
879 | if (OBJ_obj2nid(CMS_get0_type(cms)) != NID_id_smime_ct_compressedData) { | ||
880 | CMSerror(CMS_R_TYPE_NOT_COMPRESSED_DATA); | ||
881 | return 0; | ||
882 | } | ||
883 | |||
884 | if (!dcont && !check_content(cms)) | ||
885 | return 0; | ||
886 | |||
887 | cont = CMS_dataInit(cms, dcont); | ||
888 | if (!cont) | ||
889 | return 0; | ||
890 | r = cms_copy_content(out, cont, flags); | ||
891 | do_free_upto(cont, dcont); | ||
892 | |||
893 | return r; | ||
894 | } | ||
895 | |||
896 | CMS_ContentInfo * | ||
897 | CMS_compress(BIO *in, int comp_nid, unsigned int flags) | ||
898 | { | ||
899 | CMS_ContentInfo *cms; | ||
900 | |||
901 | if (comp_nid <= 0) | ||
902 | comp_nid = NID_zlib_compression; | ||
903 | cms = cms_CompressedData_create(comp_nid); | ||
904 | if (!cms) | ||
905 | return NULL; | ||
906 | |||
907 | if (!(flags & CMS_DETACHED)) | ||
908 | CMS_set_detached(cms, 0); | ||
909 | |||
910 | if ((flags & CMS_STREAM) || CMS_final(cms, in, NULL, flags)) | ||
911 | return cms; | ||
912 | |||
913 | CMS_ContentInfo_free(cms); | ||
914 | |||
915 | return NULL; | ||
916 | } | ||
917 | |||
918 | #else | ||
919 | |||
920 | int | 871 | int |
921 | CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) | 872 | CMS_uncompress(CMS_ContentInfo *cms, BIO *dcont, BIO *out, unsigned int flags) |
922 | { | 873 | { |
@@ -930,5 +881,3 @@ CMS_compress(BIO *in, int comp_nid, unsigned int flags) | |||
930 | CMSerror(CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); | 881 | CMSerror(CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); |
931 | return NULL; | 882 | return NULL; |
932 | } | 883 | } |
933 | |||
934 | #endif | ||