/usr/include/dislocker/ssl_bindings.h is in libdislocker0-dev 0.7.1-3build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 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 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | /* -*- coding: utf-8 -*- */
/* -*- mode: c -*- */
/*
* Dislocker -- enables to read/write on BitLocker encrypted partitions under
* Linux
* Copyright (C) 2012-2013 Romain Coltel, Hervé Schauer Consultants
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*/
#ifndef SSL_BINDINGS_H
#define SSL_BINDINGS_H
/*
* Here stand the bindings for polarssl SHA256/SHA2/SHA-2 function for dislocker
*/
#include "mbedtls/config.h"
#include "mbedtls/version.h"
#include "mbedtls/aes.h"
// Function's name changed
#if defined(MBEDTLS_SHA256_C)
# include "mbedtls/sha256.h"
# define SHA256(input, len, output) mbedtls_sha256(input, len, output, 0)
#else /* defined(MBEDTLS_SHA256_C) */
# if defined(POLARSSL_SHA256_C)
# include "polarssl/sha256.h"
# define SHA256(input, len, output) sha256(input, len, output, 0)
# else /* defined(POLARSSL_SHA256_C) */
# include "polarssl/sha2.h"
// 0x00630500 = version 0.99.5, argument's type changed in this release
# if POLARSSL_VERSION_NUMBER >= 0x00630500
# define SHA256(input, len, output) sha2(input, len, output, 0)
# else
# define SHA256(input, len, output) sha2(input, (int)len, output, 0)
# endif /* POLARSSL_VERSION_NUMBER >= 0x00630500 */
# endif /* defined(POLARSSL_SHA256_C) */
#endif /* defined(MBEDTLS_SHA256_C) */
/* Here stand the bindings for AES functions and contexts */
#if defined(MBEDTLS_AES_H)
# define AES_CONTEXT mbedtls_aes_context
# define AES_SETENC_KEY(ctx, key, size) mbedtls_aes_setkey_enc(ctx, key, size)
# define AES_SETDEC_KEY(ctx, key, size) mbedtls_aes_setkey_dec(ctx, key, size)
# define AES_ECB_ENC(ctx, mode, in, out) mbedtls_aes_crypt_ecb(ctx, mode, in, out)
# define AES_CBC(ctx, mode, size, iv, in, out) \
mbedtls_aes_crypt_cbc(ctx, mode, size, iv, in, out);
# define AES_ENCRYPT MBEDTLS_AES_ENCRYPT
# define AES_DECRYPT MBEDTLS_AES_DECRYPT
#else
# define AES_CONTEXT aes_context
# define AES_SETENC_KEY(ctx, key, size) aes_setkey_enc(ctx, key, size)
# define AES_SETDEC_KEY(ctx, key, size) aes_setkey_dec(ctx, key, size)
# define AES_ECB_ENC(ctx, mode, in, out) aes_crypt_ecb(ctx, mode, in, out)
# define AES_CBC(ctx, mode, size, iv, in, out) \
aes_crypt_cbc(ctx, mode, size, iv, in, out);
#endif /* defined(MBEDTLS_AES_H) */
#include "dislocker/encryption/aes-xts.h"
#if defined(MBEDTLS_CIPHER_MODE_XEX)
# define AES_XEX(ctx1, ctx2, mode, size, iv, in, out) \
mbedtls_aes_crypt_xex(ctx1, ctx2, mode, size, iv, in, out)
#else
# define AES_XEX(ctx1, ctx2, mode, size, iv, in, out) \
dis_aes_crypt_xex(ctx1, ctx2, mode, size, iv, in, out)
#endif /* defined(MBEDTLS_CIPHER_MODE_XEX) */
# define AES_XTS(ctx1, ctx2, mode, size, iv, in, out) \
dis_aes_crypt_xts(ctx1, ctx2, mode, size, iv, in, out)
#endif /* SSL_BINDINGS_H */
|