Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

tax.c

Go to the documentation of this file.
00001 #include "system.h"
00002                                                                                 
00003 #include "base64.h"
00004 #include "mpbarrett.h"
00005 #include "mp.h"
00006 #include "popt.h"
00007                                                                                 
00008 #include "debug.h"
00009 
00010 const char * applechallenge = "09KF45soMYmvj6dpsUGiIg==";
00011 
00012 #if 1
00013 const char * rsaaeskey = "\
00014 5QYIqmdZGTONY5SHjEJrqAhaa0W9wzDC5i6q221mdGZJ5ubO6Kg\
00015 yhC6U83wpY87TFdPRdfPQl2kVC7+Uefmx1bXdIUo07ZcJsqMbgtje4w2JQw0b\
00016 Uw2BlzNPmVGQOxfdpGc3LXZzNE0jI1D4conUEiW6rrzikXBhk7Y/i2naw13ayy\
00017 xaSwtkiJ0ltBQGYGErbV2tx43QSNj7O0JIG9GrF2GZZ6/UHo4VH+ZXgQ4NZvP/\
00018 QXPCsLutZsvusFDzIEq7TN1fveINOiwrzlN+bckEixvhXlvoQTWE2tjbmQYhMvO\
00019 FIly5gNbZiXi0l5AdolX4jDC2vndFHqWDks/3sPikNg==\
00020 ";
00021 #else
00022 const char * rsaaeskey = "5QYIqmdZGTONY5SHjEJrqAhaa0W9wzDC5i6q221mdGZJ5ubO6KgyhC6U83wpY87TFdPRdfPQl2kVC7+Uefmx1bXdIUo07ZcJsqMbgtje4w2JQw0bUw2BlzNPmVGQOxfdpGc3LXZzNE0jI1D4conUEiW6rrzikXBhk7Y/i2naw13ayyxaSwtkiJ0ltBQGYGErbV2tx43QSNj7O0JIG9GrF2GZZ6/UHo4VH+ZXgQ4NZvP/QXPCsLutZsvusFDzIEq7TN1fveINOiwrzlN+bckEixvhXlvoQTWE2tjbmQYhMvOFIly5gNbZiXi0l5AdolX4jDC2vndFHqWDks/3sPikNg==";
00023 #endif
00024 
00025 const char * aesiv = "zcZmAZtqh7uGcEwPXk0QeA==";
00026 
00027 const char * appleresponse = "\
00028 u+msU8Cc7KBrVPjI/Ir8fOL8+C5D3Jsw1+acaW3MNTndrTQAeb/a\
00029 5m10UVBX6wb/DYQGY+b28ksSwBjN0nFOk4Y2cODEf83FAh7B\
00030 mkLpmpkpplp7zVXQ+Z9DcB6gC60ZsS3t98aoR7tSzVLKZNgi2X2sC+vGsz\
00031 utQxX03HK008VjcdngHv3g1p2knoETd07T6eVfZCmPqp6Ga7Dj8VIIj/GEP3\
00032 AjjDx3lJnQBXUDmxM484YXLXZjWFXCiY8GJt6whjf7/2c3rIoT3Z7PQpEvPmM\
00033 1MXU9cv4NL59Y/q0OAVQ38foOz7eGAhfvjOsCnHU25aik7/7ToIYt1tyVtap/kA==\
00034 ";
00035 
00043 /*@unused@*/ static inline
00044 char * pgpHexCvt(/*@returned@*/ char *t, const byte *s, int nbytes)
00045         /*@modifies *t @*/
00046 {
00047     static char hex[] = "0123456789abcdef";
00048 /*@-boundswrite@*/
00049     while (nbytes-- > 0) {
00050         unsigned int i;
00051         i = *s++;
00052         *t++ = hex[ (i >> 4) & 0xf ];
00053         *t++ = hex[ (i     ) & 0xf ];
00054     }
00055     *t = '\0';
00056 /*@=boundswrite@*/
00057     return t;
00058 }
00059 
00067 /*@unused@*/ static inline /*@observer@*/
00068 char * pgpHexStr(const byte *p, unsigned int plen)
00069         /*@*/
00070 {
00071     static char prbuf[2048];
00072     char *t = prbuf;
00073     t = pgpHexCvt(t, p, plen);
00074     return prbuf;
00075 }
00076 
00077 static int doit(const char * msg, const char * sig)
00078 {
00079     unsigned char * dec;
00080     size_t declen;
00081     int rc;
00082 
00083     if ((rc = b64decode(sig, (void **)&dec, &declen)) != 0) {
00084         fprintf(stderr, "*** b64decode returns %d\n", rc);
00085         return rc;
00086     }
00087 
00088     fprintf(stderr, "*** %p[%d] %s\n", dec, declen, msg);
00089     if (declen == 256) {
00090         fprintf(stderr, "%s\n", pgpHexStr(dec, declen/2));
00091         fprintf(stderr, "%s\n", pgpHexStr(dec+declen/2, declen/2));
00092     } else {
00093         fprintf(stderr, "%s\n", pgpHexStr(dec, declen));
00094     }
00095 
00096     return 0;
00097 
00098 }
00099 
00100 int
00101 main (int argc, char *argv[])
00102 {
00103 
00104     doit("applechallenge", applechallenge);
00105     doit("rsaaeskey", rsaaeskey);
00106     doit("aesiv", aesiv);
00107     doit("appleresponse", appleresponse);
00108 }

Generated on Mon Mar 5 13:30:24 2007 for rpm by  doxygen 1.4.4