~ubuntu-branches/ubuntu/trusty/libssh/trusty

« back to all changes in this revision

Viewing changes to include/libssh/crypto.h

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2009-12-12 14:29:12 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20091212142912-ha5g2iibt6nfnjq8
Tags: 0.4.0-1
* New upstream release.
  - Bump soname
  - Adjust .symbols file
* Readd static library in -dev package
* Let dh_lintian install override file
* debian/README.Debian: Update file
* debian/rules: Add list-missing rule

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 * This file is part of the SSH Library
3
3
 *
4
 
 * Copyright (c) 2003      by Aris Adamantiadis
 
4
 * Copyright (c) 2003,2009 by Aris Adamantiadis
5
5
 *
6
6
 * The SSH Library is free software; you can redistribute it and/or modify
7
7
 * it under the terms of the GNU Lesser General Public License as published by
20
20
 */
21
21
 
22
22
/*
23
 
 * crypto.h is an include file for internal structures of libssh
24
 
 * It hasn't to be into the final development set of files (and btw
25
 
 * the filename would cause problems on most systems).
 
23
 * crypto.h is an include file for internal cryptographic structures of libssh
26
24
 */
27
25
 
 
26
#ifndef _CRYPTO_H_
 
27
#define _CRYPTO_H_
 
28
 
 
29
#include "config.h"
 
30
 
 
31
#ifdef HAVE_LIBGCRYPT
 
32
#include <gcrypt.h>
 
33
#endif
 
34
#include "libssh/wrapper.h"
 
35
 
28
36
#ifdef cbc_encrypt
29
37
#undef cbc_encrypt
30
38
#endif
32
40
#undef cbc_decrypt
33
41
#endif
34
42
 
35
 
#ifdef GCRYPT
36
 
#include <gcrypt.h>
37
 
#endif
 
43
struct ssh_crypto_struct {
 
44
    bignum e,f,x,k,y;
 
45
    unsigned char session_id[SHA_DIGEST_LEN];
 
46
 
 
47
    unsigned char encryptIV[SHA_DIGEST_LEN*2];
 
48
    unsigned char decryptIV[SHA_DIGEST_LEN*2];
 
49
 
 
50
    unsigned char decryptkey[SHA_DIGEST_LEN*2];
 
51
    unsigned char encryptkey[SHA_DIGEST_LEN*2];
 
52
 
 
53
    unsigned char encryptMAC[SHA_DIGEST_LEN];
 
54
    unsigned char decryptMAC[SHA_DIGEST_LEN];
 
55
    unsigned char hmacbuf[EVP_MAX_MD_SIZE];
 
56
    struct crypto_struct *in_cipher, *out_cipher; /* the cipher structures/objects */
 
57
    ssh_string server_pubkey;
 
58
    const char *server_pubkey_type;
 
59
    int do_compress_out; /* idem */
 
60
    int do_compress_in; /* don't set them, set the option instead */
 
61
    void *compress_out_ctx; /* don't touch it */
 
62
    void *compress_in_ctx; /* really, don't */
 
63
};
38
64
 
39
65
struct crypto_struct {
40
66
    const char *name; /* ssh name of the algorithm */
66
92
};
67
93
 
68
94
/* vim: set ts=2 sw=2 et cindent: */
 
95
#endif /* _CRYPTO_H_ */