~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to linux/crypto/ciphers/aes/test_main_mac.c

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <stdio.h>
 
2
#include <sys/types.h>
 
3
#include <string.h>
 
4
#include "aes.h"
 
5
#include "aes_xcbc_mac.h"
 
6
#define STR "Hola guasssso c|mo estais ...012"  
 
7
void print_hash(const __u8 *hash) {
 
8
        printf("%08x %08x %08x %08x\n", 
 
9
                        *(__u32*)(&hash[0]), 
 
10
                        *(__u32*)(&hash[4]), 
 
11
                        *(__u32*)(&hash[8]), 
 
12
                        *(__u32*)(&hash[12]));
 
13
}
 
14
int main(int argc, char *argv[]) {
 
15
        aes_block key= { 0xdeadbeef, 0xceedcaca, 0xcafebabe, 0xff010204 };
 
16
        __u8  hash[16];
 
17
        char *str = argv[1];
 
18
        aes_context_mac ctx;
 
19
        if (str==NULL) {
 
20
                fprintf(stderr, "pasame el str\n");
 
21
                return 255;
 
22
        }
 
23
        AES_xcbc_mac_set_key(&ctx, (__u8 *)&key, sizeof(key));
 
24
        AES_xcbc_mac_hash(&ctx, str, strlen(str), hash);
 
25
        print_hash(hash);
 
26
        str[2]='x';
 
27
        AES_xcbc_mac_hash(&ctx, str, strlen(str), hash);
 
28
        print_hash(hash);
 
29
        return 0;
 
30
}