[xar] r231 committed - Preparing for 1.5.3 with patch for toc signing issue.

2 views
Skip to first unread message

codesite...@google.com

unread,
Apr 11, 2010, 4:08:08 PM4/11/10
to xar-c...@googlegroups.com
Revision: 231
Author: bbraun
Date: Sun Apr 11 13:07:17 2010
Log: Preparing for 1.5.3 with patch for toc signing issue.

http://code.google.com/p/xar/source/detail?r=231

Modified:
/branches/xar-1.5/configure.ac
/branches/xar-1.5/lib/archive.c
/branches/xar-1.5/lib/signature.c
/branches/xar-1.5/src/xar.1

=======================================
--- /branches/xar-1.5/configure.ac Sat Dec 29 11:04:09 2007
+++ /branches/xar-1.5/configure.ac Sun Apr 11 13:07:17 2010
@@ -1,5 +1,5 @@
AC_PREREQ(2.59)
-AC_INIT([Xar], [1.5.2], [xar-...@googlegroups.com], [xar])
+AC_INIT([Xar], [1.5.3], [xar-...@googlegroups.com], [xar])
AC_CONFIG_SRCDIR([LICENSE])

dnl Revision number for libxar.
@@ -8,7 +8,7 @@

dnl xar version variables.
XAR_MAJOR_VERSION="1"
-XAR_MINOR_VERSION="5.2"
+XAR_MINOR_VERSION="5.3"
XAR_VERSION="${XAR_MAJOR_VERSION}.${XAR_MINOR_VERSION}"
AC_SUBST([XAR_MAJOR_VERSION])
AC_SUBST([XAR_MINOR_VERSION])
=======================================
--- /branches/xar-1.5/lib/archive.c Sun Dec 9 12:08:37 2007
+++ /branches/xar-1.5/lib/archive.c Sun Apr 11 13:07:17 2010
@@ -285,6 +285,44 @@
return ret;

EVP_DigestFinal(&XAR(ret)->toc_ctx, toccksum, &tlen);
+
+ const char *value;
+ uint64_t offset = 0;
+ uint64_t length = tlen;
+ if( xar_prop_get( XAR_FILE(ret) , "checksum/offset", &value) == 0 ) {
+ errno = 0;
+ offset = strtoull( value, (char **)NULL, 10);
+ if( errno != 0 ) {
+ xar_close(ret);
+ return NULL;
+ }
+ } else if( xar_signature_first(ret) != NULL ) {
+ // All archives that have a signature also specify the location
+ // of the checksum. If the location isn't specified, error out.
+ xar_close(ret);
+ return NULL;
+ }
+
+ XAR(ret)->heap_offset = xar_get_heap_offset(ret) + offset;
+ if( lseek(XAR(ret)->fd, XAR(ret)->heap_offset, SEEK_SET) == -1 ) {
+ xar_close(ret);
+ return NULL;
+ }
+ if( xar_prop_get( XAR_FILE(ret) , "checksum/size", &value) == 0 ) {
+ errno = 0;
+ length = strtoull( value, (char **)NULL, 10);
+ if( errno != 0 ) {
+ xar_close(ret);
+ return NULL;
+ }
+ } else if( xar_signature_first(ret) != NULL ) {
+ xar_close(ret);
+ return NULL;
+ }
+ if( length != tlen ) {
+ xar_close(ret);
+ return NULL;
+ }

xar_read_fd(XAR(ret)->fd, cval, tlen);
XAR(ret)->heap_offset += tlen;
=======================================
--- /branches/xar-1.5/lib/signature.c Fri Feb 2 12:50:35 2007
+++ /branches/xar-1.5/lib/signature.c Sun Apr 11 13:07:17 2010
@@ -381,7 +381,7 @@

/* <size> */
xmlTextWriterStartElementNS( writer, NULL, BAD_CAST("size"), NULL);
- xmlTextWriterWriteFormatString(writer, "%ld", (XAR_SIGNATURE(sig)->len));
+ xmlTextWriterWriteFormatString(writer, "%" PRId32,
(XAR_SIGNATURE(sig)->len));
xmlTextWriterEndElement(writer);

/* <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"> */
=======================================
--- /branches/xar-1.5/src/xar.1 Sat Dec 29 11:04:09 2007
+++ /branches/xar-1.5/src/xar.1 Sun Apr 11 13:07:17 2010
@@ -1,4 +1,4 @@
-.TH XAR "1" "December 29, 2007" "version 1.5.2" "User Commands"
+.TH XAR "1" "April 11, 2010" "version 1.5.3" "User Commands"
.SH NAME
xar \- eXtensible ARchiver
.SH SYNOPSIS

Reply all
Reply to author
Forward
0 new messages