<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
On 3/27/2012 3:33 PM, Bogdan Ivanov wrote:
<blockquote
cite="mid:1332851626.84380.YahooMailNeo@web111805.mail.gq1.yahoo.com"
type="cite">
<div style="color:#000; background-color:#fff; font-family:times
new roman, new york, times, serif;font-size:12pt">
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: 13px; ">Salut,</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;"><br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Nu reusesc sa apelez functiile de
decriptare din server, cel mai probabil pentru ca nu incarc
libraria cum trebuie.</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Eu fac asa: cu include "crypto.h" in
server il compilez cu:</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">gcc -Wall -lrt -o server server.o
common.o<br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">caz in care
obtin: server.c:(.text+0x1e9): undefined reference to
`decrypt_base64'</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;"><br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">probabil ca ar trebui inclusa libraria la
compilare nu? Folosind flag-ul -l</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Am incercat si cu:</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;"><br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">gcc -Wall -lrt -llibcrypto -o gateway
gateway.o common.o dar:<br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">/usr/bin/ld: cannot find -llibcrypto<br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">(daca are vreo importanta din terminarul
din care rulez make am setat variabila de mediu
LD_LIBRARY_PATH)</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;"><br>
</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Cum trebuie incarcata libraria corect?</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Multumesc,</span></div>
<div><span style="font-family: arial, helvetica, sans-serif;
font-size: small;">Bogdan</span></div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
<a class="moz-txt-link-freetext" href="http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii">http://elf.cs.pub.ro/so/wiki/resurse/lista-discutii</a></pre>
</blockquote>
Salut!<br>
Nu reusesc sa imi dau seama de ce primesc Bad Magic Number la apelul
de decrypt_des.<br>
In este de tip void * si este rezultatul intors de functia
shmem_attach, iar size este primul numar care se afla in memoria
partajata<br>
decrypt_des( (int *)in + sizeof(size), size,out);<br>
<br>
Daca apelez in felul urmator, primesc Bad Address.<br>
l = decrypt_des( in + 4, size, out);<br>
Ideea mea este sa incep decriptarea de la adresa de inceput a
memoriei partajate + dimensiunea ocupata de primul numar.<br>
Ma poate ajuta cineva cu un sfat?<br>
Multumesc!<br>
</body>
</html>