<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem running c program calling md5_string function in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936838#M806044</link>
    <description>.</description>
    <pubDate>Fri, 28 Oct 2005 01:22:18 GMT</pubDate>
    <dc:creator>JESUS GARCIA</dc:creator>
    <dc:date>2005-10-28T01:22:18Z</dc:date>
    <item>
      <title>Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936830#M806036</link>
      <description>This program compile correctly but md5_string function doesn't return nothing:&lt;BR /&gt;&lt;BR /&gt;desar# cc md.c -o md -lcryptx&lt;BR /&gt;desar# ./md hola             &lt;BR /&gt;Error: Cannot hash string hola&lt;BR /&gt;desar#&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;     1  #include &lt;STDIO.H&gt;&lt;BR /&gt;     2  #include &lt;MD5.H&gt;&lt;BR /&gt;     3  #include &lt;UNISTD.H&gt;&lt;BR /&gt;     4&lt;BR /&gt;     5  off_t md5_string(unsigned char *bufp, off_t len, unsigned char digest[])&lt;BR /&gt;;&lt;BR /&gt;     6&lt;BR /&gt;     7  void obtener_md5 (unsigned char *my_string, off_t my_len)&lt;BR /&gt;     8  {&lt;BR /&gt;     9     unsigned char my_digest[MD5_HSIZE];&lt;BR /&gt;    10     int i = 0;&lt;BR /&gt;    11&lt;BR /&gt;    12     if ((md5_string(my_string, my_len, my_digest)) &amp;lt; 0) {&lt;BR /&gt;    13       printf ("Error: Cannot hash string %s\n",my_string );&lt;BR /&gt;    14       return;&lt;BR /&gt;    15     }&lt;BR /&gt;    16&lt;BR /&gt;    17     for (i = 0; i &amp;lt; MD5_HSIZE; i++) printf("%02x", my_digest[i] );&lt;BR /&gt;    18  }&lt;BR /&gt;    19&lt;BR /&gt;    20&lt;BR /&gt;    21  int main(int argc, unsigned char **argv)&lt;BR /&gt;    22  {&lt;BR /&gt;        23    unsigned char *my_string;&lt;BR /&gt;    24    unsigned char my_digest[MD5_HSIZE];&lt;BR /&gt;    25    off_t my_len;&lt;BR /&gt;    26    int i = 0;&lt;BR /&gt;    27&lt;BR /&gt;    28    if (argc != 2)&lt;BR /&gt;    29    {&lt;BR /&gt;    30      fprintf(stderr, "Uso: md cadena\n");&lt;BR /&gt;    31      exit(2);&lt;BR /&gt;    32    }&lt;BR /&gt;    33&lt;BR /&gt;    34    my_string  = argv[1];&lt;BR /&gt;    35&lt;BR /&gt;    36    if ((md5_string(my_string, my_len, my_digest)) &amp;lt; 0) {&lt;BR /&gt;    37      printf ("Error: Cannot hash string %s\n",my_string );&lt;BR /&gt;    38      exit(1);&lt;BR /&gt;    39    }&lt;BR /&gt;    40&lt;BR /&gt;    41    printf ("Hash md5 de la cadena %s de longitud %i :\n",my_string, my_le&lt;BR /&gt;n);&lt;BR /&gt;    42    for (i = 0; i &amp;lt; MD5_HSIZE; i++) printf("%02x", my_digest[i] );&lt;BR /&gt;        43    printf ("\n");&lt;BR /&gt;    44    exit(0);&lt;BR /&gt;    45  }&lt;BR /&gt;&lt;BR /&gt;&lt;/UNISTD.H&gt;&lt;/MD5.H&gt;&lt;/STDIO.H&gt;</description>
      <pubDate>Thu, 27 Oct 2005 02:47:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936830#M806036</guid>
      <dc:creator>JESUS GARCIA</dc:creator>
      <dc:date>2005-10-27T02:47:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936831#M806037</link>
      <description>The bundle "HP-UX MD5 Secure Checksum" was installed without problems:&lt;BR /&gt;&lt;BR /&gt;desar:/# uname -a &lt;BR /&gt;HP-UX desar B.11.11 U 9000/800 4221864724 unlimited-user license&lt;BR /&gt;desar:/# swlist -l product | grep MD5&lt;BR /&gt;  LibCryptX             A.01.00.00     HP-UX LibCryptX (MD5 APIs) &lt;BR /&gt;  MD5sum                A.01.00.00     HP-UX MD5sum (md5sum Command)&lt;BR /&gt;&lt;BR /&gt;Sample runnning "md5sum" command:&lt;BR /&gt;&lt;BR /&gt;desar:/# echo "hola\c" | md5sum -k&lt;BR /&gt;4d186321c1a7f0f354b297e8914ab240 4 &lt;BR /&gt;desar:/#</description>
      <pubDate>Thu, 27 Oct 2005 02:58:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936831#M806037</guid>
      <dc:creator>JESUS GARCIA</dc:creator>
      <dc:date>2005-10-27T02:58:02Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936832#M806038</link>
      <description>Hola,&lt;BR /&gt;&lt;BR /&gt;34 my_string = argv[1];&lt;BR /&gt;35 my_len = strlen(my_string);&lt;BR /&gt;36 if ((md5_string(my_string, my_len, my_digest)) &amp;lt; 0) {&lt;BR /&gt;37 printf ("Error: Cannot hash string %s\n",my_string );&lt;BR /&gt;38 exit(1);&lt;BR /&gt;&lt;BR /&gt;Would that help? I don't have the man page for md5_string, so I'm guessing.&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Oct 2005 03:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936832#M806038</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-10-27T03:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936833#M806039</link>
      <description>Thanks, but some result.&lt;BR /&gt;&lt;BR /&gt;Man page says "my_len" is an output parameter:&lt;BR /&gt;&lt;BR /&gt;The md5_string() function hashes an arbitrary finite stream of data (similar to the example in the preceding paragraph). It returns the    digest in the output parameter and the string size as a return argument.&lt;BR /&gt;&lt;BR /&gt;I attach Md5 man pages.</description>
      <pubDate>Thu, 27 Oct 2005 06:13:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936833#M806039</guid>
      <dc:creator>JESUS GARCIA</dc:creator>
      <dc:date>2005-10-27T06:13:44Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936834#M806040</link>
      <description>Can you see if errno is being set when md5_string() is called, and if so, what value it contains. Might give us a clue.</description>
      <pubDate>Thu, 27 Oct 2005 11:25:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936834#M806040</guid>
      <dc:creator>Stephen Keane</dc:creator>
      <dc:date>2005-10-27T11:25:23Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936835#M806041</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;After including Stephen's suggestion in your code i.e.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;&amp;gt; my_len = strlen(my_string); &amp;lt;&amp;lt;&lt;BR /&gt;&lt;BR /&gt;compile your program in 64-bit mode by supplying the +DD64 switch...&lt;BR /&gt;&lt;BR /&gt;# cc +DD64 md.c -o md -lcryptx&lt;BR /&gt;&lt;BR /&gt;For 32-bit compilation replace md5_string() routine with the 32-bit primitives i.e.&lt;BR /&gt;&lt;BR /&gt;md5_init()&lt;BR /&gt;md5_update()&lt;BR /&gt;md5_final()&lt;BR /&gt;&lt;BR /&gt;cheers!&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Oct 2005 17:06:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936835#M806041</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-10-27T17:06:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936836#M806042</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Attached is the code for the "md" program that uses the core 32-bit APIs i.e.&lt;BR /&gt;&lt;BR /&gt;md5_init()&lt;BR /&gt;md5_update()&lt;BR /&gt;md5_final()&lt;BR /&gt;&lt;BR /&gt;It'll run on both 32 and 64-bit machines. However the md5-string() function needs to be compiled in 64-bit mode.&lt;BR /&gt;&lt;BR /&gt;Hope it helps...Enjoy!!!</description>
      <pubDate>Thu, 27 Oct 2005 18:12:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936836#M806042</guid>
      <dc:creator>Sandman!</dc:creator>
      <dc:date>2005-10-27T18:12:26Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936837#M806043</link>
      <description>Thank you very much Sandman.&lt;BR /&gt;Both solutions work fine.</description>
      <pubDate>Fri, 28 Oct 2005 01:20:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936837#M806043</guid>
      <dc:creator>JESUS GARCIA</dc:creator>
      <dc:date>2005-10-28T01:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem running c program calling md5_string function</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936838#M806044</link>
      <description>.</description>
      <pubDate>Fri, 28 Oct 2005 01:22:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-running-c-program-calling-md5-string-function/m-p/4936838#M806044</guid>
      <dc:creator>JESUS GARCIA</dc:creator>
      <dc:date>2005-10-28T01:22:18Z</dc:date>
    </item>
  </channel>
</rss>

