~ubuntu-branches/debian/jessie/cryptsetup/jessie

« back to all changes in this revision

Viewing changes to lib/crypto_backend/crypto_kernel.c

  • Committer: Package Import Robot
  • Author(s): Jonas Meurer
  • Date: 2012-02-05 03:17:59 UTC
  • mfrom: (0.2.9)
  • Revision ID: package-import@ubuntu.com-20120205031759-kua3bplwunj0q2zl
Tags: 2:1.4.1-1
* new upstream release (1.4.0 + 1.4.1) (closes: #647851)
  - fixes typo in german translation. (closes: #645528)
  - remove patches, all incorporated upstream.
  - soname bump, rename library package to libcryptsetup4
* check for busybox in initramfs cryptroot hook, and install the sed binary
  in case it's either not installed or not activated. (closes: #591853)
* add checks for 'type $KEYSCRIPT' to initscripts cryptdisks.functions, and
  to cryptroot initramfs script/hook. this adds support for keyscripts inside
  $PATH. thanks to Ian Jackson for the suggestion. (closes: #597583)
* use argument '--sysinit' for vgchange in cryptroot initramfs script. Thanks
  to Christoph Anton Mitterer for the suggestion.
* add option for discard/trim features to crypttab and initramfs scripts.
  Thanks to intrigeri and Peter Colberg for patches. (closes: #648868)
* print $target on error in initramfs hook. Thanks to Daniel Hahler for the
  bugreport. (closes: #648192)
* add a warning about using decrypt_derived keyscript for devices with
  persistent data. Thanks to Arno Wagner for pointing this out.
* remove quotes from resume device candidates at get_resume_devs() in
  initramfs hook script. Thanks to Johannes Rohr. (closes: #634017)
* support custom $TABFILE, thanks to Douglas Huff. (closes: #638317)
* fix get_lvm_deps() in initramfs cryptroot hook to add all physical volumes
  of lvm volume group that contains the rootfs logical volume, even if the
  rootfs is lv is not spread over all physical volumes. Thanks to Christian
  Pernegger for bugreport and patch. (closes: #634109)
* debian/initramfs/cryptroot-script: Move check for maximum number of tries
  behind the while loop, to make the warning appear in case that maximum
  number of tries is reached. Thanks to Chistian Lamparter for bugreport and
  patch. (closes: #646083)
* incorporate changes to package descriptions and debconf templates that
  suggested by debian-l10n-english people. Special thanks go to Justin B Rye.
* acknowledge NMU, thanks a lot to Christian Perrier for his great work on
  the i18n front. (closes: #633105, #641719, #641839, #641947, #642470,
  #640056, #642540, #643633, #643962, #644853)
* add and update debconf translations:
  - italian, thanks to Milo Casagrande, Francesca Ciceri. (closes: #656933)
  - german, thanks to Erik Pfannenstein. (closes: #642147)
  - spanish, thanks to Camaleón. (closes: #658360)
  - russian, thanks to Yuri Kuzlov (closes: #654676)
* set architecture to linux-any, depends on linux kernel anyway. Thanks to
  Christoph Egger. (closes: #638257)
* small updates to the copyright file.
* add targets build-indep and build-arch to debian/rules, thanks to lintian.

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 *
15
15
 * You should have received a copy of the GNU General Public License
16
16
 * along with this program; if not, write to the Free Software
17
 
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18
18
 */
19
19
 
20
20
#include <string.h>
30
30
/* FIXME: remove later */
31
31
#ifndef AF_ALG
32
32
#define AF_ALG 38
 
33
#endif
 
34
#ifndef SOL_ALG
33
35
#define SOL_ALG 279
34
36
#endif
35
37
 
174
176
        return 0;
175
177
}
176
178
 
177
 
int crypt_hash_restart(struct crypt_hash *ctx)
178
 
{
179
 
        return 0;
180
 
}
181
 
 
182
179
int crypt_hash_write(struct crypt_hash *ctx, const char *buffer, size_t length)
183
180
{
184
181
        ssize_t r;
185
182
 
186
183
        r = send(ctx->opfd, buffer, length, MSG_MORE);
187
 
        if (r < 0 || r < length)
 
184
        if (r < 0 || (size_t)r < length)
188
185
                return -EIO;
189
186
 
190
187
        return 0;
194
191
{
195
192
        ssize_t r;
196
193
 
197
 
        if (length > ctx->hash_len)
 
194
        if (length > (size_t)ctx->hash_len)
198
195
                return -EINVAL;
199
196
 
200
197
        r = read(ctx->opfd, buffer, length);
259
256
        return 0;
260
257
}
261
258
 
262
 
int crypt_hmac_restart(struct crypt_hmac *ctx)
263
 
{
264
 
        return 0;
265
 
}
266
 
 
267
259
int crypt_hmac_write(struct crypt_hmac *ctx, const char *buffer, size_t length)
268
260
{
269
261
        ssize_t r;
270
262
 
271
263
        r = send(ctx->opfd, buffer, length, MSG_MORE);
272
 
        if (r < 0 || r < length)
 
264
        if (r < 0 || (size_t)r < length)
273
265
                return -EIO;
274
266
 
275
267
        return 0;
279
271
{
280
272
        ssize_t r;
281
273
 
282
 
        if (length > ctx->hash_len)
 
274
        if (length > (size_t)ctx->hash_len)
283
275
                return -EINVAL;
284
276
 
285
277
        r = read(ctx->opfd, buffer, length);