-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* genisoimage/jte.c: add support for bzip2-compressed templates
* genisoimage/jte.c: fix bzip2-compressed template data to be compatible with jigdo. * genisoimage/jte.c: fix exclude list handling. * genisoimage/checksum.[ch]: Add a generic infrastructure for checksums so we can use sha1/<whatever> as well as just md5sum. Will make things much faster for generating sha1sums for images and jigdos. * genisoimage/sha1.[ch]: Add GPL-licensed SHA1 implementation. * s/mkisofs/genisoimage/ in ABOUT git-svn-id: svn://svn.debian.org/debburn/cdrkit/trunk@785 a95a6be8-091b-0410-adaf-d31e6857962f
- Loading branch information
93sam
committed
Jan 6, 2008
1 parent
1fdbab8
commit c27b852
Showing
10 changed files
with
827 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,13 +27,13 @@ This package contains the following software: | |
cdrecord by Jörg Schilling <[email protected]> but | ||
developed independently now. | ||
|
||
- mkisofs (an ISO-9660 filesystem image creator) | ||
- genisoimage (an ISO-9660 filesystem image creator) | ||
By Eric Youngdale <[email protected]>, Jörg Schilling | ||
<[email protected]>, James Pearson | ||
<[email protected]> and other contributors. | ||
|
||
- mkhybrid (an ISO-9660/HFS filesystem image creator) | ||
Link to mkisofs | ||
Link to genisoimage | ||
|
||
- several diagnostic programs for ISO-9660, originaly from | ||
cdrtools (by Jörg Schilling), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,11 +4,18 @@ cdrkit (1.1.7) UNRELEASED; urgency=low | |
* wodim.1: small fixes. | ||
|
||
[ Steve McIntyre ] | ||
* genisoimage/jte.c: add support for bzip2-compressed templates | ||
* genisoimage/jte.c: fix bzip2-compressed template data to be | ||
compatible with jigdo. | ||
* genisoimage/jte.c: fix exclude list handling. | ||
|
||
-- Steve McIntyre <[email protected]> Wed, 19 Sep 2007 22:03:04 +0100 | ||
* genisoimage/checksum.[ch]: Add a generic infrastructure for | ||
checksums so we can use sha1/<whatever> as well as just | ||
md5sum. Will make things much faster for generating sha1sums for | ||
images and jigdos. | ||
* genisoimage/sha1.[ch]: Add GPL-licensed SHA1 implementation. | ||
* s/mkisofs/genisoimage/ in ABOUT | ||
|
||
-- Steve McIntyre <[email protected]> Sun, 06 Jan 2008 02:32:42 +0000 | ||
|
||
cdrkit (1.1.6) RELEASED; urgency=low | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ Priority: optional | |
Section: otherosfs | ||
Maintainer: Joerg Jaspert <[email protected]> | ||
Uploaders: Eduard Bloch <[email protected]>, Steve McIntyre <[email protected]> | ||
Build-Depends: debhelper (>=5.0.37.3), zlib1g-dev, autotools-dev, cmake (>= 2.4.2-1), libcap-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libcam-dev [kfreebsd-i386 kfreebsd-amd64], libmagic-dev | ||
Build-Depends: debhelper (>=5.0.37.3), libbz2-dev, zlib1g-dev, autotools-dev, cmake (>= 2.4.2-1), libcap-dev [!kfreebsd-i386 !kfreebsd-amd64 !hurd-i386], libcam-dev [kfreebsd-i386 kfreebsd-amd64], libmagic-dev | ||
Standards-Version: 3.7.2 | ||
|
||
Package: wodim | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
/* | ||
* checksum.c | ||
* | ||
* Copyright (c) 2008- Steve McIntyre <[email protected]> | ||
* | ||
* Implementation of a generic checksum interface, used in JTE. | ||
* | ||
* GNU GPL v2 | ||
*/ | ||
|
||
#include <mconfig.h> | ||
#include "genisoimage.h" | ||
#include <timedefs.h> | ||
#include <fctldefs.h> | ||
#include <regex.h> | ||
#include <stdlib.h> | ||
#include "md5.h" | ||
#include "sha1.h" | ||
#include "checksum.h" | ||
|
||
static void md5_init(void *context) | ||
{ | ||
mk_MD5Init(context); | ||
} | ||
static void md5_update(void *context, unsigned char const *buf, unsigned int len) | ||
{ | ||
mk_MD5Update(context, buf, len); | ||
} | ||
static void md5_final(unsigned char *digest, void *context) | ||
{ | ||
mk_MD5Final(digest, context); | ||
} | ||
|
||
static void sha1_init(void *context) | ||
{ | ||
sha1_init_ctx(context); | ||
} | ||
static void sha1_update(void *context, unsigned char const *buf, unsigned int len) | ||
{ | ||
sha1_process_bytes(buf, len, context); | ||
} | ||
static void sha1_final(unsigned char *digest, void *context) | ||
{ | ||
sha1_finish_ctx(context, digest); | ||
} | ||
|
||
struct checksum_details | ||
{ | ||
char *name; | ||
int digest_size; | ||
int context_size; | ||
void (*init)(void *context); | ||
void (*update)(void *context, unsigned char const *buf, unsigned int len); | ||
void (*final)(unsigned char *digest, void *context); | ||
}; | ||
|
||
static const struct checksum_details algorithms[] = | ||
{ | ||
{ | ||
"MD5", | ||
16, | ||
sizeof(struct mk_MD5Context), | ||
md5_init, | ||
md5_update, | ||
md5_final | ||
}, | ||
{ | ||
"SHA1", | ||
20, | ||
sizeof(struct sha1_ctx), | ||
sha1_init, | ||
sha1_update, | ||
sha1_final | ||
} | ||
}; | ||
|
||
struct _checksum_context | ||
{ | ||
void *context; | ||
unsigned char *digest; | ||
int enabled; | ||
}; | ||
|
||
struct checksum_info *checksum_information(enum checksum_types which) | ||
{ | ||
return (struct checksum_info *)&algorithms[which]; | ||
} | ||
|
||
checksum_context_t *checksum_init_context(int checksums) | ||
{ | ||
int i = 0; | ||
struct _checksum_context *context = malloc(NUM_CHECKSUMS * sizeof(struct _checksum_context)); | ||
if (!context) | ||
return NULL; | ||
|
||
for (i = 0; i < NUM_CHECKSUMS; i++) | ||
{ | ||
if ( (1 << i) & checksums) | ||
{ | ||
context[i].context = malloc(algorithms[i].context_size); | ||
if (!context[i].context) | ||
return NULL; | ||
context[i].digest = malloc(algorithms[i].digest_size); | ||
if (!context[i].digest) | ||
return NULL; | ||
algorithms[i].init(context[i].context); | ||
context[i].enabled = 1; | ||
} | ||
else | ||
context[i].enabled = 0; | ||
} | ||
|
||
return context; | ||
} | ||
|
||
void checksum_free_context(checksum_context_t *context) | ||
{ | ||
int i = 0; | ||
struct _checksum_context *c = context; | ||
|
||
for (i = 0; i < NUM_CHECKSUMS; i++) | ||
{ | ||
free(c[i].context); | ||
free(c[i].digest); | ||
} | ||
free(c); | ||
} | ||
|
||
void checksum_update(checksum_context_t *context, | ||
unsigned char const *buf, unsigned int len) | ||
{ | ||
int i = 0; | ||
struct _checksum_context *c = context; | ||
|
||
for (i = 0; i < NUM_CHECKSUMS; i++) | ||
{ | ||
if (c[i].enabled) | ||
algorithms[i].update(c[i].context, buf, len); | ||
} | ||
} | ||
|
||
void checksum_final(checksum_context_t *context) | ||
{ | ||
int i = 0; | ||
struct _checksum_context *c = context; | ||
|
||
for (i = 0; i < NUM_CHECKSUMS; i++) | ||
{ | ||
if (c[i].enabled) | ||
algorithms[i].final(c[i].digest, c[i].context); | ||
} | ||
} | ||
|
||
void checksum_copy(checksum_context_t *context, | ||
enum checksum_types which, | ||
unsigned char *digest) | ||
{ | ||
struct _checksum_context *c = context; | ||
|
||
if (c[which].enabled) | ||
memcpy(digest, c[which].digest, algorithms[which].digest_size); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/* | ||
* checksum.h | ||
* | ||
* Copyright (c) 2008- Steve McIntyre <[email protected]> | ||
* | ||
* Definitions and prototypes for a generic checksum interface, used | ||
* in JTE. Inspired heavily by the interface to the MD5 code we're | ||
* using already. | ||
* | ||
* GNU GPL v2 | ||
*/ | ||
|
||
enum checksum_types | ||
{ | ||
CHECK_MD5 = 0, | ||
CHECK_SHA1, | ||
NUM_CHECKSUMS | ||
}; | ||
|
||
#define CHECK_MD5_USED (1 << CHECK_MD5) | ||
#define CHECK_SHA1_USED (1 << CHECK_SHA1) | ||
|
||
typedef void checksum_context_t; | ||
|
||
struct checksum_info | ||
{ | ||
char *name; | ||
int digest_size; | ||
}; | ||
|
||
/* Ask the library for information about a particular checksum | ||
* algorithm. Returns a pointer to internal memory - DO NOT | ||
* MODIFY/FREE! */ | ||
struct checksum_info *checksum_information(enum checksum_types which); | ||
|
||
/* Allocate / initialise a context for the chosen checksums. OR | ||
* together the desired checksums as the parameter */ | ||
checksum_context_t *checksum_init_context(int checksums); | ||
|
||
/* Cleanup and free a context when it's finished with */ | ||
void checksum_free_context(checksum_context_t *context); | ||
|
||
/* Pass a new buffer full of data through the checksum code */ | ||
void checksum_update(checksum_context_t *context, | ||
unsigned char const *buf, | ||
unsigned int len); | ||
|
||
/* Finish the current set of checksums */ | ||
void checksum_final(checksum_context_t *context); | ||
|
||
/* Extract a particular algorithm's checksum once checksum_final() has | ||
* been called. Use the details in checksum_information() above first | ||
* to see how big the digest will be. */ | ||
void checksum_copy(checksum_context_t *context, | ||
enum checksum_types which, | ||
unsigned char *digest); |
Oops, something went wrong.