debian/0000755000000000000000000000000012141537003007162 5ustar debian/compat0000644000000000000000000000000212055676310010371 0ustar 7 debian/libb64-0d.symbols0000644000000000000000000000037512056160153012167 0ustar libb64.so.0d libb64-0d #MINVER# base64_decode_block@Base 1.2 base64_decode_value@Base 1.2 base64_encode_block@Base 1.2 base64_encode_blockend@Base 1.2 base64_encode_value@Base 1.2 base64_init_decodestate@Base 1.2 base64_init_encodestate@Base 1.2 debian/control0000644000000000000000000000171012060153217010565 0ustar Source: libb64 Section: libs Priority: optional Maintainer: Jakub Wilk Build-Depends: debhelper (>= 8.1.3~), dpkg-dev (>= 1.16.0~), xutils-dev, Standards-Version: 3.9.4 Homepage: http://libb64.sourceforge.net/ Package: libb64-0d Architecture: any Multi-Arch: same Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Description: base64 encoding/decoding library - runtime library libb64 is a library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format. . This package provides the runtime library. Package: libb64-dev Section: libdevel Architecture: any Multi-Arch: same Depends: ${misc:Depends}, libb64-0d (= ${binary:Version}) Description: base64 encoding/decoding library - development files libb64 is a library of ANSI C routines for fast encoding/decoding data into and from a base64-encoded format. . This package provides the static library and headers for C and C++. debian/patches/0000755000000000000000000000000012074016235010615 5ustar debian/patches/bufsiz-as-buffer-size.diff0000644000000000000000000000167112056130060015567 0ustar Description: use BUFSIZ as buffer size Author: Jakub Wilk Bug: http://sourceforge.net/tracker/?func=detail&atid=785907&aid=3591336&group_id=152942 Forwarded: no Last-Update: 2012-11-30 --- a/include/b64/decode.h +++ b/include/b64/decode.h @@ -8,6 +8,7 @@ #ifndef BASE64_DECODE_H #define BASE64_DECODE_H +#include #include namespace base64 @@ -22,7 +23,7 @@ base64_decodestate _state; int _buffersize; - decoder(int buffersize_in = BUFFERSIZE) + decoder(int buffersize_in = BUFSIZ) : _buffersize(buffersize_in) {} --- a/include/b64/encode.h +++ b/include/b64/encode.h @@ -8,6 +8,7 @@ #ifndef BASE64_ENCODE_H #define BASE64_ENCODE_H +#include #include namespace base64 @@ -22,7 +23,7 @@ base64_encodestate _state; int _buffersize; - encoder(int buffersize_in = BUFFERSIZE) + encoder(int buffersize_in = BUFSIZ) : _buffersize(buffersize_in) {} debian/patches/series0000644000000000000000000000023112074014336012026 0ustar override-cflags.diff no-hardcoded-lib-path.diff integer-overflows.diff bufsiz-as-buffer-size.diff static-chars-per-line.diff initialize-coder-state.diff debian/patches/initialize-coder-state.diff0000644000000000000000000000114512074016235016021 0ustar Description: initialize encoder/decoder state in the constructors Author: Jakub Wilk Forwarded: no Last-Update: 2013-01-11 --- a/include/b64/decode.h +++ b/include/b64/decode.h @@ -25,7 +25,9 @@ decoder(int buffersize_in = BUFSIZ) : _buffersize(buffersize_in) - {} + { + base64_init_decodestate(&_state); + } int decode(char value_in) { --- a/include/b64/encode.h +++ b/include/b64/encode.h @@ -25,7 +25,9 @@ encoder(int buffersize_in = BUFSIZ) : _buffersize(buffersize_in) - {} + { + base64_init_encodestate(&_state); + } int encode(char value_in) { debian/patches/static-chars-per-line.diff0000644000000000000000000000067412056174250015556 0ustar Description: do not export the CHARS_PER_LINE variable Author: Jakub Wilk Bug: http://sourceforge.net/tracker/?func=detail&aid=3591420&group_id=152942&atid=785907 Forwarded: yes Last-Update: 2012-11-30 --- a/src/cencode.c +++ b/src/cencode.c @@ -7,7 +7,7 @@ #include -const int CHARS_PER_LINE = 72; +static const int CHARS_PER_LINE = 72; void base64_init_encodestate(base64_encodestate* state_in) { debian/patches/integer-overflows.diff0000644000000000000000000000466212056130061015132 0ustar Description: fix integer overflows Author: Jakub Wilk Bug: http://sourceforge.net/tracker/?func=detail&aid=3591129&group_id=152942&atid=785907 Last-Update: 2012-11-30 --- a/src/cdecode.c +++ b/src/cdecode.c @@ -9,10 +9,11 @@ int base64_decode_value(char value_in) { - static const char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; + static const signed char decoding[] = {62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,-2,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51}; static const char decoding_size = sizeof(decoding); + if (value_in < 43) return -1; value_in -= 43; - if (value_in < 0 || value_in > decoding_size) return -1; + if (value_in > decoding_size) return -1; return decoding[(int)value_in]; } @@ -26,7 +27,7 @@ { const char* codechar = code_in; char* plainchar = plaintext_out; - char fragment; + int fragment; *plainchar = state_in->plainchar; @@ -42,7 +43,7 @@ state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar = (fragment & 0x03f) << 2; case step_b: @@ -53,7 +54,7 @@ state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x030) >> 4; *plainchar = (fragment & 0x00f) << 4; @@ -65,7 +66,7 @@ state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x03c) >> 2; *plainchar = (fragment & 0x003) << 6; @@ -77,7 +78,7 @@ state_in->plainchar = *plainchar; return plainchar - plaintext_out; } - fragment = (char)base64_decode_value(*codechar++); + fragment = base64_decode_value(*codechar++); } while (fragment < 0); *plainchar++ |= (fragment & 0x03f); } debian/patches/override-cflags.diff0000644000000000000000000000113012056127757014532 0ustar Description: make overriding CFLAGS possible Author: Jakub Wilk Forwarded: no Last-Update: 2012-11-30 --- a/base64/Makefile +++ b/base64/Makefile @@ -3,7 +3,7 @@ # Build flags (uncomment one) ############################# # Release build flags -CFLAGS += -O3 +CFLAGS ?= -O3 ############################# # Debug build flags #CFLAGS += -g --- a/src/Makefile +++ b/src/Makefile @@ -3,7 +3,7 @@ # Build flags (uncomment one) ############################# # Release build flags -CFLAGS += -O3 +CFLAGS ?= -O3 ############################# # Debug build flags #CFLAGS += -g debian/patches/no-hardcoded-lib-path.diff0000644000000000000000000000042512056130062015470 0ustar Description: don't hardcore library path Author: Jakub Wilk Forwarded: no Last-Update: 2012-11-30 --- a/base64/Makefile +++ b/base64/Makefile @@ -34,7 +34,7 @@ all: $(TARGETS) #strip -base64: libb64.a +base64: -lb64 strip: strip $(BINARIES) *.exe debian/copyright0000644000000000000000000000601012075317113011116 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: libb64 Upstream-Contact: Chris Venter Source: http://libb64.sourceforge.net/ Files: * Copyright: none License: public-domain Copyright-Only Dedication (based on United States law) or Public Domain Certification . The person or persons who have associated work with this document (the "Dedicator" or "Certifier") hereby either (a) certifies that, to the best of his knowledge, the work of authorship identified is in the public domain of the country from which the work is published, or (b) hereby dedicates whatever copyright the dedicators holds in the work of authorship identified below (the "Work") to the public domain. A certifier, moreover, dedicates any copyright interest he may have in the associated work, and for these purposes, is described as a "dedicator" below. . A certifier has taken reasonable steps to verify the copyright status of this work. Certifier recognizes that his good faith efforts may not shield him from liability if in fact the work certified is not in the public domain. . Dedicator makes this dedication for the benefit of the public at large and to the detriment of the Dedicator's heirs and successors. Dedicator intends this dedication to be an overt act of relinquishment in perpetuity of all present and future rights under copyright law, whether vested or contingent, in the Work. Dedicator understands that such relinquishment of all rights includes the relinquishment of all rights to enforce (by lawsuit or otherwise) those copyrights in the Work. . Dedicator recognizes that, once placed in the public domain, the Work may be freely reproduced, distributed, transmitted, used, modified, built upon, or otherwise exploited by anyone for any purpose, commercial or non-commercial, and in any way, including by methods that have not yet been invented or conceived. Files: debian/* Copyright: 2012 Jakub Wilk License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/watch0000644000000000000000000000011212055677161010223 0ustar version=3 http://sf.net/libb64/libb64-([0-9.]+)[.]src[.](?:zip|tar[.]gz)$ debian/changelog0000644000000000000000000000110112141537003011025 0ustar libb64 (1.2-3) unstable; urgency=low * Upload to unstable. * Don't use dh_testdir; instead, use makefile rules to ensure that debian/rules can be only run in the correct directory. -- Jakub Wilk Sun, 05 May 2013 22:16:02 +0200 libb64 (1.2-2) experimental; urgency=low * Initialize encoder/decoder state in the constructors. -- Jakub Wilk Fri, 11 Jan 2013 15:08:40 +0100 libb64 (1.2-1) experimental; urgency=low * Initial release (closes: #694724). -- Jakub Wilk Fri, 07 Dec 2012 12:59:19 +0100 debian/get-orig-source.sh0000644000000000000000000000105612055677667012564 0ustar #!/bin/sh set -e export TAR_OPTIONS='--owner root --group root --mode a+rX' export GZIP_OPTIONS='-9n' pwd=$(pwd) version="$1" if [ -z "$version" ] then printf 'Usage: %s \n' "$0" exit 1 fi cd "$(dirname "$0")/../" tmpdir=$(mktemp -t -d get-orig-source.XXXXXX) uscan --noconf --force-download --rename --download-version="$version" --destdir="$tmpdir" cd "$tmpdir" unzip -q libb64*.zip rm libb64*.zip mv libb64*/ libb64-${version}.orig tar -czvvf "$pwd/libb64_${version}.orig.tar.gz" libb64-*.orig/ cd .. rm -rf "$tmpdir" # vim:ts=4 sw=4 et debian/source/0000755000000000000000000000000012055676542010502 5ustar debian/source/format0000644000000000000000000000001412055676542011710 0ustar 3.0 (quilt) debian/rules0000755000000000000000000000343612141536654010263 0ustar #!/usr/bin/make -f static_lib = libb64.a shared_lib = libb64.so soversion = 0d soname = $(shared_lib).$(soversion) libdir = /usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/ cflags = \ $(shell dpkg-buildflags --get CFLAGS) \ $(shell dpkg-buildflags --get CPPFLAGS) ldflags = $(shell dpkg-buildflags --get LDFLAGS) .PHONY: build build-indep build-arch build build-arch: build-stamp build-stamp: debian/control Makefile dh_testdir rm -rf src-shlib/ cp -a src src-shlib/ cd src-shlib/ && rm -f *.o *.a CFLAGS="$(cflags)" LDFLAGS="$(ldflags)" $(MAKE) CFLAGS="$(cflags) -fPIC" $(MAKE) -C src-shlib/ cd src-shlib && $(CC) $(ldflags) -shared -Wl,-soname,$(soname) *.o -o $(soname) cd src-shlib && ln -sf $(soname) $(shared_lib) ifeq "$(filter nocheck,$(DEB_BUILD_OPTIONS))" "" debian/tests/libb64-dev --build-time endif touch $(@) .PHONY: binary binary-indep binary-arch binary binary-arch: debian/control build-stamp dh_testdir dh_testroot dh_prep dh_install -p libb64-dev src/$(static_lib) $(libdir) dh_install -p libb64-dev src-shlib/$(shared_lib) $(libdir) dh_install -p libb64-dev include/* /usr/include/ dh_install -p libb64-$(soversion) src-shlib/$(soname) $(libdir) dh_installdocs AUTHORS BENCHMARKS README dh_installchangelogs CHANGELOG dh_compress dh_fixperms dh_strip dh_makeshlibs -- -c4 dh_shlibdeps dh_installdeb dh_gencontrol dh_md5sums dh_builddeb .PHONY: clean clean: debian/control Makefile $(MAKE) clean rm -rf src-shlib/ dh_clean */depend here = $(dir $(firstword $(MAKEFILE_LIST)))/.. debian_version = $(word 2,$(shell cd $(here) && dpkg-parsechangelog | grep ^Version:)) upstream_version = $(firstword $(subst -, ,$(debian_version))) .PHONY: get-orig-source get-orig-source: sh $(here)/debian/get-orig-source.sh $(upstream_version) # vim:ts=4 sw=4 noet debian/tests/0000755000000000000000000000000012056201624010326 5ustar debian/tests/libb64-dev0000755000000000000000000000267312056201624012122 0ustar #!/bin/sh log_begin() { printf ' %s ... ' "$*" } log_end() { if [ -n "$*" ] then printf 'ok\n' return 0 else printf 'FAIL\n' return 1 fi } set -e -u export LC_ALL=C rc=0 build_time= make_flags=-s if [ "$*" = '--build-time' ] then build_time=build-time ADTTMP=debian/tmp/adt/ mkdir -p $ADTTMP rm -rf $ADTTMP/* fi cp -a base64/ "$ADTTMP/cmdline" cd "$ADTTMP" if [ -z "$build_time" ] then make $make_flags -C cmdline # Check if it's dynamically linked: log_begin 'dynamic linking to libb64' ok=yes ldd cmdline/base64 | grep -w libb64.so >/dev/null || ok= log_end $ok || rc=1 fi ln -sf /bin/sh big.orig printf 'x' > tiny.orig for tc in *.orig do base=${tc%.orig} # --------- log_begin "$base: decoder" ok=yes base64 $base.orig > $base.coreutils cmdline/base64 -d $base.coreutils $base.coreutils.libb64 || ok= cmp $base.orig $base.coreutils.libb64 || ok= log_end $ok || rc=1 # --------- log_begin "$base: encoder" ok=yes cmdline/base64 -e $base.orig $base.libb64 || ok= base64 -d $base.libb64 > $base.libb64.coreutils || ok= cmp $base.orig $base.libb64.coreutils || ok= log_end $ok || rc=1 # --------- log_begin "$base: round-trip" ok=yes cmdline/base64 -d $base.libb64 $base.libb64.libb64 || ok= cmp $base.orig $base.libb64.libb64 || ok= log_end $ok || rc=1 done exit $rc # vim:ts=4 sw=4 et debian/tests/control0000644000000000000000000000005312055715454011741 0ustar Tests: libb64-dev Depends: g++, libb64-dev