RE: Compiling on a Mac

2008-02-07 Thread Jeremy Farrell
 From: Larry Bugbee
 
  The source for incremental_send isn't in the book anywhere 
  that I've seen.  I'm using the first edition (June 2002).
  My code does call incremental_send, and the code I'm trying
  to compile is the example code provided in the book itself
  (in chapter 6 - see example 6-4). The book provides the
  code for incremental_encrypt as well as incremental_finish,
  so my assumption is that it is a method included in the
  bowels of the libraries provided.  Are you saying that this  
  is a method that I must construct myself?  The book doesn't
  say that, so my assumption is that it is provided.
 
 I have run into books that claim to be good but the publisher leaves  
 out critical stuff.  Go to the publisher's site and look for errata  
 and downloadable source files.

Good advice in general, but not relevant in this case. The
discussion of the example in the book says of incremental_send
which is simply a stub, but it can place those blocks currently
encrypted on the network. It's just a place-holder in the example,
indicating 'this is where you do something with the data you've
encrypted'. It's up to the developer to provide the functionality.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-07 Thread Joel Christner
As an aside, anyone have issues with unrecognized symbols
EVP_CIPHER_CTX_block_size?

I've tried including everything under the sun - evp.h, bio.h, err.h, rand.h,
ssl.h, x509v3.h.


On Feb 7, 2008 5:20 PM, Jeremy Farrell [EMAIL PROTECTED] wrote:

  From: Larry Bugbee
 
   The source for incremental_send isn't in the book anywhere
   that I've seen.  I'm using the first edition (June 2002).
   My code does call incremental_send, and the code I'm trying
   to compile is the example code provided in the book itself
   (in chapter 6 - see example 6-4). The book provides the
   code for incremental_encrypt as well as incremental_finish,
   so my assumption is that it is a method included in the
   bowels of the libraries provided.  Are you saying that this
   is a method that I must construct myself?  The book doesn't
   say that, so my assumption is that it is provided.
 
  I have run into books that claim to be good but the publisher leaves
  out critical stuff.  Go to the publisher's site and look for errata
  and downloadable source files.

 Good advice in general, but not relevant in this case. The
 discussion of the example in the book says of incremental_send
 which is simply a stub, but it can place those blocks currently
 encrypted on the network. It's just a place-holder in the example,
 indicating 'this is where you do something with the data you've
 encrypted'. It's up to the developer to provide the functionality.
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



Re: Compiling on a Mac

2008-02-07 Thread Victor Duchovni
On Thu, Feb 07, 2008 at 05:42:59PM -0800, Joel Christner wrote:

 As an aside, anyone have issues with unrecognized symbols
 EVP_CIPHER_CTX_block_size?
 
 I've tried including everything under the sun - evp.h, bio.h, err.h, rand.h,
 ssl.h, x509v3.h.

This changed from a macro in older OpenSSL releases to a function in
newer ones. If you link code compiled using new headers against older
libraries, the function will not be found. Don't do that.

-- 
Viktor.
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Compiling on a Mac

2008-02-06 Thread David Schwartz

 Can you share the code that you found, a link to it, or at
 least a hint as to which search engine you found it on?

 http://www.cs.odu.edu/~cs772/sourcecode/NSwO/compiled/encdec.c

There you go.

I'm curious -- do you understand what the code you are compiling is supposed
to actually *do*? Because if my understanding is correct, it only makes
sense if you have a source of a stream of bytes and a sink for the stream of
bytes and are trying to interpose an encryption/decryption step in the
middle. If you don't have these two things, the code will not work because
it will have no idea where to get its input from and where to send its
output to.

At least, that's my understanding. If your understanding is different, share
it. If you don't understand what the code is supposed to do, stop trying to
make it work. You will have no way to know when you've succeeded. ;)

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-06 Thread Larry Bugbee
The source for incremental_send isn't in the book anywhere that I've  
seen.  I'm using the first edition (June 2002).  My code does call  
incremental_send, and the code I'm trying to compile is the example  
code provided in the book itself (in chapter 6 - see example 6-4).   
The book provides the code for incremental_encrypt as well as  
incremental_finish, so my assumption is that it is a method included  
in the bowels of the libraries provided.  Are you saying that this  
is a method that I must construct myself?  The book doesn't say  
that, so my assumption is that it is provided.


I have run into books that claim to be good but the publisher leaves  
out critical stuff.  Go to the publisher's site and look for errata  
and downloadable source files.



__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-06 Thread Joel Christner
Hi David,

Yes indeed I do.  I have seen that link before, but it doesn't contain the
contents of incremental_send (this data is left hanging in limbo with
nothing to do).  My goal is to integrate this into a sockets application I'm
using where there will indeed be a continuous stream of data.

Thanks
Joel




On Feb 6, 2008 1:09 AM, David Schwartz [EMAIL PROTECTED] wrote:


  Can you share the code that you found, a link to it, or at
  least a hint as to which search engine you found it on?

  http://www.cs.odu.edu/~cs772/sourcecode/NSwO/compiled/encdec.chttp://www.cs.odu.edu/%7Ecs772/sourcecode/NSwO/compiled/encdec.c

 There you go.

 I'm curious -- do you understand what the code you are compiling is
 supposed
 to actually *do*? Because if my understanding is correct, it only makes
 sense if you have a source of a stream of bytes and a sink for the stream
 of
 bytes and are trying to interpose an encryption/decryption step in the
 middle. If you don't have these two things, the code will not work because
 it will have no idea where to get its input from and where to send its
 output to.

 At least, that's my understanding. If your understanding is different,
 share
 it. If you don't understand what the code is supposed to do, stop trying
 to
 make it work. You will have no way to know when you've succeeded. ;)

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



RE: Compiling on a Mac

2008-02-06 Thread David Schwartz

 Hi David,

 Yes indeed I do.  I have seen that link before,
 but it doesn't contain the contents of incremental_send
 (this data is left hanging in limbo with nothing to do).

That is the contents of incremental_send.

 My goal is to integrate this into a sockets application
 I'm using where there will indeed be a continuous stream
 of data.  

It won't link until you do that.

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-05 Thread Kyle Hamilton

on Mac, dynamically-loaded libraries have the extension .dylib, not .so.

On Feb 3, 2008, at 11:04 AM, Michael Sierchio wrote:


Joel Christner wrote:


The issue I'm seeing is when compiling:
mac# openssl version
OpenSSL 0.9.7l 28 Sep 2006
mac# gcc blowfish.c -o blowfish
...
Undefined symbols:


Basic C compiler/linker usage error.

gcc blowfish.c -o blowfish -Llocation of libcrypt.so -lcrypto

or something very much like that.

- M
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Au


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-05 Thread Joel Christner
Hi David,

The source for incremental_send isn't in the book anywhere that I've seen.
I'm using the first edition (June 2002).  My code does call
incremental_send, and the code I'm trying to compile is the example code
provided in the book itself (in chapter 6 - see example 6-4).  The book
provides the code for incremental_encrypt as well as incremental_finish, so
my assumption is that it is a method included in the bowels of the libraries
provided.  Are you saying that this is a method that I must construct
myself?  The book doesn't say that, so my assumption is that it is provided.

Thanks
Joel


On Feb 5, 2008 6:19 PM, David Schwartz [EMAIL PROTECTED] wrote:



  Ummm, I realize that.  I've tried hunting down where the
  incremental_send method is and I can't find it anywhere.

 It's in your book.

  Can you give some suggestions on the rational troubleshooting
  you recommend?

 Check your source code for references to incremental_send. You can use
 grep for this purpose.

  I have no idea what the cc4DdydW.o file is, I'm assuming this
  is being produced by the compiler.

 It could be, but there's really no way to tell. One good way to figure out
 what it is would be to compile your code and then separately link it. This
 will allow you to easily check what symbols each file defines and which
 symbols it needs.

  Where is the symbol table and how do I examine it?

 The nm command will do this.

  Pardon my ignorance.  I've also googled for incremental_send, which
  per the OpenSSL book I'm using is supposed to be contained in one of the
  OpenSSL files that 'm including, and google doesn't provide me anything
  useful on it.

 I think you are misunderstanding the book. I think it provides
 incremental_send as an example function. You call this function without
 providing the code for it, hence the reason it shows up as undefined.

 Does your code call incremental_send?

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



RE: Compiling on a Mac

2008-02-05 Thread David Schwartz


 The source for incremental_send isn't in the book anywhere
 that I've seen.

Well then that explains the problem. You are calling a function that does
not exist.

 I'm using the first edition (June 2002).
 My code does call incremental_send,
 and the code I'm trying to compile is the example code provided in the
 book itself (in chapter 6 - see example 6-4).

I don't have your book, but I found similar example code online that calls
incremental_send and it always includes the actual code for
incremental_send.

 The book provides the code for incremental_encrypt as well as
 incremental_finish, so my assumption is that it is a method
 included in the bowels of the libraries provided.

If that were true, it would show that you are going the wrong way. You
should be using OpenSSL's documented interface, not functions deep in its
bowels.

 Are you saying that this is a method that I must construct myself?

Yes.

 The book doesn't say that, so my assumption is that it is provided.

I don't have the book you have, but every example I was able to find online
that called incremental_send included an implementation of it. This is one
example:

http://www.cs.odu.edu/~cs772/sourcecode/NSwO/compiled/encdec.c

I think the correct assumption is that the example *assumes* you have coded
an incremental_send function and is intended to demonstrate the plumbing
between OpenSSL's encryption/decryption engine and an incremental transmit
function.

This is strongly implied by the excerpt of the book I was able to find on
Amazon. This is intended to demonstrate an encryption/decryption
implementation as a stream filter. It assumes the data comes from someplace,
gets encrypted or decrypted, and then goes someplace else. The
incremental_send function is intended to be the goes someplace else
function.

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-05 Thread Joel Christner
Can you share the code that you found, a link to it, or at least a hint as
to which search engine you found it on?

On Feb 5, 2008 8:01 PM, David Schwartz [EMAIL PROTECTED] wrote:



  The source for incremental_send isn't in the book anywhere
  that I've seen.

 Well then that explains the problem. You are calling a function that does
 not exist.

  I'm using the first edition (June 2002).
  My code does call incremental_send,
  and the code I'm trying to compile is the example code provided in the
  book itself (in chapter 6 - see example 6-4).

 I don't have your book, but I found similar example code online that calls
 incremental_send and it always includes the actual code for
 incremental_send.

  The book provides the code for incremental_encrypt as well as
  incremental_finish, so my assumption is that it is a method
  included in the bowels of the libraries provided.

 If that were true, it would show that you are going the wrong way. You
 should be using OpenSSL's documented interface, not functions deep in its
 bowels.

  Are you saying that this is a method that I must construct myself?

 Yes.

  The book doesn't say that, so my assumption is that it is provided.

 I don't have the book you have, but every example I was able to find
 online
 that called incremental_send included an implementation of it. This is
 one
 example:

 http://www.cs.odu.edu/~cs772/sourcecode/NSwO/compiled/encdec.chttp://www.cs.odu.edu/%7Ecs772/sourcecode/NSwO/compiled/encdec.c

 I think the correct assumption is that the example *assumes* you have
 coded
 an incremental_send function and is intended to demonstrate the plumbing
 between OpenSSL's encryption/decryption engine and an incremental transmit
 function.

 This is strongly implied by the excerpt of the book I was able to find on
 Amazon. This is intended to demonstrate an encryption/decryption
 implementation as a stream filter. It assumes the data comes from
 someplace,
 gets encrypted or decrypted, and then goes someplace else. The
 incremental_send function is intended to be the goes someplace else
 function.

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



RE: Compiling on a Mac

2008-02-05 Thread David Schwartz

 Hi David,

 I'm down to symbol not defined for one item - incremental_send
 (and I can't find what file this is supposed to be in).

Well, you need to do that.

 I re-installed to /usr/include/openssl and used --prefix=/usr/include
 and --openssldir=/usr/include/openssl

 I'm trying to compile now with -lssl -lcrypto -L/usr/include/openssl

Did you verify that -lssl -lcrypto goes to the newly installed version of
OpenSSL?

 I believe -lssl tried linking to a legacy version of openssl
 (I saw a thread on this on the openssl website FAQ section).

You need to engage in some kind of rational troubleshooting. You have a
theory -- -lssl is linking to the wrong library version -- and you haven't
either confirmed that or ruled it out. That should be the very first thing
you do.

One easy way to do that is to replace '-lssl -lcrypto' with the full path of
the libraries you just compiled.

 Here's what I'm getting now when I try and compile - this
 appears to be the only error.

 Undefined symbols:
   _incremental_send, referenced from:
   _incremental_encrypt in cc4DdydW.o
   _incremental_finish in cc4DdydW.o
 ld: symbol(s) not found
 collect2: ld returned 1 exit status

It sounds like you call a function called 'incremental_send' that doesn't
exist. What is cc4DdydW.o?

Did you check your own source code for the string incremental? Did you
check the symbol table of libraries you are linking to to figure out where
that's coming from? Did you check all available libraries on your system to
see if any of them contain an incremental_send function?

You need to follow some kind of troubleshooting process.

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-05 Thread Joel Christner
Ummm, I realize that.  I've tried hunting down where the incremental_send
method is and I can't find it anywhere.  Can you give some suggestions on
the rational troubleshooting you recommend?  I have no idea what the
cc4DdydW.o file is, I'm assuming this is being produced by the compiler.
Where is the symbol table and how do I examine it?  Pardon my ignorance.
I've also googled for incremental_send, which per the OpenSSL book I'm
using is supposed to be contained in one of the OpenSSL files that 'm
including, and google doesn't provide me anything useful on it.

Thanks
Joel


On Feb 5, 2008 12:13 PM, David Schwartz [EMAIL PROTECTED] wrote:


  Hi David,

  I'm down to symbol not defined for one item - incremental_send
  (and I can't find what file this is supposed to be in).

 Well, you need to do that.

  I re-installed to /usr/include/openssl and used --prefix=/usr/include
  and --openssldir=/usr/include/openssl

  I'm trying to compile now with -lssl -lcrypto -L/usr/include/openssl

 Did you verify that -lssl -lcrypto goes to the newly installed version
 of
 OpenSSL?

  I believe -lssl tried linking to a legacy version of openssl
  (I saw a thread on this on the openssl website FAQ section).

 You need to engage in some kind of rational troubleshooting. You have a
 theory -- -lssl is linking to the wrong library version -- and you haven't
 either confirmed that or ruled it out. That should be the very first thing
 you do.

 One easy way to do that is to replace '-lssl -lcrypto' with the full path
 of
 the libraries you just compiled.

  Here's what I'm getting now when I try and compile - this
  appears to be the only error.

  Undefined symbols:
_incremental_send, referenced from:
_incremental_encrypt in cc4DdydW.o
_incremental_finish in cc4DdydW.o
  ld: symbol(s) not found
  collect2: ld returned 1 exit status

 It sounds like you call a function called 'incremental_send' that doesn't
 exist. What is cc4DdydW.o?

 Did you check your own source code for the string incremental? Did you
 check the symbol table of libraries you are linking to to figure out where
 that's coming from? Did you check all available libraries on your system
 to
 see if any of them contain an incremental_send function?

 You need to follow some kind of troubleshooting process.

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



RE: Compiling on a Mac

2008-02-05 Thread David Schwartz


 Ummm, I realize that.  I've tried hunting down where the
 incremental_send method is and I can't find it anywhere.

It's in your book.

 Can you give some suggestions on the rational troubleshooting
 you recommend?

Check your source code for references to incremental_send. You can use
grep for this purpose.

 I have no idea what the cc4DdydW.o file is, I'm assuming this
 is being produced by the compiler.

It could be, but there's really no way to tell. One good way to figure out
what it is would be to compile your code and then separately link it. This
will allow you to easily check what symbols each file defines and which
symbols it needs.

 Where is the symbol table and how do I examine it?

The nm command will do this.

 Pardon my ignorance.  I've also googled for incremental_send, which
 per the OpenSSL book I'm using is supposed to be contained in one of the
 OpenSSL files that 'm including, and google doesn't provide me anything
 useful on it.

I think you are misunderstanding the book. I think it provides
incremental_send as an example function. You call this function without
providing the code for it, hence the reason it shows up as undefined.

Does your code call incremental_send?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Compiling on a Mac

2008-02-04 Thread Joel Christner
Hi everyone,

I'm having a build issue on a Mac (10.5) that resembles the problem
mentioned on the FAQ page:

http://www.openssl.org/support/faq.html#BUILD9

I searched my HDD for a 'PROBLEMS' file and the only one I found was for
emacs.

mac# openssl version
OpenSSL 0.9.7l 28 Sep 2006

The issue I'm seeing is when compiling:

mac# gcc blowfish.c -o blowfish
...
Undefined symbols:
  _incremental_send, referenced from:
  _incremental_encrypt in ccbqFUEC.o
  _incremental_finish in ccbqFUEC.o
  _EVP_DecryptUpdate, referenced from:
  _decrypt_example in ccbqFUEC.o
  _EVP_EncryptInit, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _EVP_bf_cbc, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _setup_for_decryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _main in ccbqFUEC.o
  _RAND_pseudo_bytes, referenced from:
  _select_random_iv in ccbqFUEC.o
  _EVP_DecryptFinal, referenced from:
  _main in ccbqFUEC.o
  _EVP_EncryptUpdate, referenced from:
  _encrypt_example in ccbqFUEC.o
  _encrypt_example in ccbqFUEC.o
  _incremental_encrypt in ccbqFUEC.o
  _EVP_DecryptInit, referenced from:
  _setup_for_decryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _RAND_bytes, referenced from:
  _select_random_key in ccbqFUEC.o
  _EVP_EncryptFinal, referenced from:
  _encrypt_example in ccbqFUEC.o
  _incremental_finish in ccbqFUEC.o
  _seed_prng, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _main in ccbqFUEC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Does anyone have any pointers or tips on how to rectify this?

Thanks for your help,
Joel


RE: Compiling on a Mac

2008-02-04 Thread Ted Mittelstaedt
Joel,

 Before compiling anything on the Mac you need to read the documents on the
Apple
website that discuss how to setup your environment properly and how to issue
the
correct C compilation commands.  Also the make on MacOS X doesen't support
all
of the features that make on some other platforms does - you might want to
start by
installing gmake.

Note also that if your
planning on distributing it you will likely want to build a PPC version as
well as an
Intel version.

Ted
  -Original Message-
  From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Joel Christner
  Sent: Sunday, February 03, 2008 1:14 PM
  To: openssl-users@openssl.org
  Subject: Re: Compiling on a Mac


  blowfish.c is a progam I wrote which contained a series of methods for
initializing, encrypting, and decrypting.

  Joel


  On Feb 3, 2008 10:51 AM, David Schwartz [EMAIL PROTECTED] wrote:



 mac# gcc blowfish.c -o blowfish


Where did you get this command from and what was it supposed to
accomplish?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]




Re: Compiling on a Mac

2008-02-04 Thread Joel Christner
Hi Ted,

Thanks, I will do that.  Any pointers on a quick fix would be appreciated
too.



On Feb 4, 2008 3:07 AM, Ted Mittelstaedt [EMAIL PROTECTED] wrote:

  Joel,

  Before compiling anything on the Mac you need to read the documents on
 the Apple
 website that discuss how to setup your environment properly and how to
 issue the
 correct C compilation commands.  Also the make on MacOS X doesen't support
 all
 of the features that make on some other platforms does - you might want to
 start by
 installing gmake.

 Note also that if your
 planning on distributing it you will likely want to build a PPC version as
 well as an
 Intel version.

 Ted

 -Original Message-
 *From:* [EMAIL PROTECTED] [mailto:
 [EMAIL PROTECTED] Behalf Of *Joel Christner
 *Sent:* Sunday, February 03, 2008 1:14 PM
 *To:* openssl-users@openssl.org
 *Subject:* Re: Compiling on a Mac

 blowfish.c is a progam I wrote which contained a series of methods for
 initializing, encrypting, and decrypting.

 Joel

 On Feb 3, 2008 10:51 AM, David Schwartz [EMAIL PROTECTED] wrote:

 
 
   mac# gcc blowfish.c -o blowfish
 
  Where did you get this command from and what was it supposed to
  accomplish?
 
  DS
 
 
  __
  OpenSSL Project http://www.openssl.org
  User Support Mailing Listopenssl-users@openssl.org
  Automated List Manager   [EMAIL PROTECTED]
 




RE: Compiling on a Mac

2008-02-04 Thread David Schwartz

 Sorry I didn't update the list, but I tried with
 -lssl and -lcrypto, as well as -I/usr/include/openssl.

And what happened? Did you get the same error messages or different ones?

 I've reinstalled openssl to no avail.

What directories did you install to? And did you tell your compiler/linker
to look in the right place?

 Any other thoughts?

Typical include lines look like this:

#include openssl/opensslconf.h

So adding /usr/include/openssl to the includes will only help if you
installed the opensslconf.h file as
/usr/include/openssl/openssl/opensslconf.h which doesn't seem to make much
sense.

Also, what file did '-lssl' actually wind up linking to? Was it the file you
installed or some other file, perhaps one that came with your system?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Compiling on a Mac

2008-02-04 Thread David Schwartz

 On Feb 3, 2008 10:51 AM, David Schwartz [EMAIL PROTECTED] wrote:
 mac# gcc blowfish.c -o blowfish

 Where did you get this command from and what
 was it supposed to accomplish?

 blowfish.c is a progam I wrote which contained a series of methods for
 initializing, encrypting, and decrypting.
 Joel

Okay, and you issued a command to compile and link your program in a single
step. The compilation succeeded, as you have no compiler errors. The linking
failed. You'll notice that you have an undefined symbol error for every
single symbol in the OpenSSL library that you tried to use. This means no
attempt was made to link to the OpenSSL library. That shouldn't be
surprising, since you didn't tell the compiler to link to the OpenSSL
library.

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-04 Thread Joel Christner
Sorry I didn't update the list, but I tried with -lssl and -lcrypto, as well
as -I/usr/include/openssl.  I've reinstalled openssl to no avail.

Any other thoughts?

Thanks

On Feb 4, 2008 9:43 AM, David Schwartz [EMAIL PROTECTED] wrote:


  On Feb 3, 2008 10:51 AM, David Schwartz [EMAIL PROTECTED] wrote:
  mac# gcc blowfish.c -o blowfish

  Where did you get this command from and what
  was it supposed to accomplish?

  blowfish.c is a progam I wrote which contained a series of methods for
  initializing, encrypting, and decrypting.
  Joel

 Okay, and you issued a command to compile and link your program in a
 single
 step. The compilation succeeded, as you have no compiler errors. The
 linking
 failed. You'll notice that you have an undefined symbol error for every
 single symbol in the OpenSSL library that you tried to use. This means no
 attempt was made to link to the OpenSSL library. That shouldn't be
 surprising, since you didn't tell the compiler to link to the OpenSSL
 library.

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



Re: Compiling on a Mac

2008-02-04 Thread Joel Christner
Hi David,

I'm down to symbol not defined for one item - incremental_send (and I can't
find what file this is supposed to be in).

I re-installed to /usr/include/openssl and used --prefix=/usr/include and
--openssldir=/usr/include/openssl

I'm trying to compile now with -lssl -lcrypto -L/usr/include/openssl

I believe -lssl tried linking to a legacy version of openssl (I saw a thread
on this on the openssl website FAQ section).

I'm using the examples in the O'Reilly OpenSSL book.  I've attached the file
I'm using for your review.

Here's what I'm getting now when I try and compile - this appears to be the
only error.

Undefined symbols:
  _incremental_send, referenced from:
  _incremental_encrypt in cc4DdydW.o
  _incremental_finish in cc4DdydW.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Thanks for your help,
Joel



On Feb 4, 2008 10:52 AM, David Schwartz [EMAIL PROTECTED] wrote:


  Sorry I didn't update the list, but I tried with
  -lssl and -lcrypto, as well as -I/usr/include/openssl.

 And what happened? Did you get the same error messages or different ones?

  I've reinstalled openssl to no avail.

 What directories did you install to? And did you tell your compiler/linker
 to look in the right place?

  Any other thoughts?

 Typical include lines look like this:

 #include openssl/opensslconf.h

 So adding /usr/include/openssl to the includes will only help if you
 installed the opensslconf.h file as
 /usr/include/openssl/openssl/opensslconf.h which doesn't seem to make
 much
 sense.

 Also, what file did '-lssl' actually wind up linking to? Was it the file
 you
 installed or some other file, perhaps one that came with your system?

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]

/*
 *
 *
 *
 *
 */

#include sys/types.h
#include sys/socket.h
#include stdio.h
#include arpa/inet.h
#include unistd.h
#include string.h
#include pthread.h
#include stdlib.h
#include netinet/in.h
#include netdb.h
#include time.h

#include openssl/evp.h
#include openssl/ssl.h
#include openssl/x509.h
#include openssl/x509v3.h
#include openssl/err.h
#include openssl/pem.h
#include openssl/rand.h
#include openssl/bio.h
#include openssl/objects.h

int seed_prng(int bytes)
{
  if (!RAND_load_file(/dev/random,bytes))
return 0;
  return 1;
}

void select_random_key(char *key,int b)
{
  int i;
  
  RAND_bytes(key,b);
  for (i=0; ib-1; i++) printf(%02X:,key[i]);
  printf(%02X\n,key[b-1]);
}

void select_random_iv(char *iv,int b)
{
  RAND_pseudo_bytes(iv,b);
}

int setup_for_encryption(void)
{
  EVP_CIPHER_CTX ctx;
  char key[EVP_MAX_KEY_LENGTH];
  char iv[EVP_MAX_IV_LENGTH];
  
  if (!seed_prng(512)) return 0;
  
  select_random_key(key,EVP_MAX_KEY_LENGTH);
  select_random_iv(iv,EVP_MAX_IV_LENGTH);
  EVP_EncryptInit(ctx,EVP_bf_cbc(),key,iv);
  return 1;
}

void setup_for_decryption(char *key,char *iv)
{
  EVP_CIPHER_CTX ctx;
  EVP_DecryptInit(ctx,EVP_bf_cbc(),key,iv);
}

char *encrypt_example(EVP_CIPHER_CTX *ctx,char *data,int inl,int *rb)
{
  char *ret;
  int i,tmp,ol;
  ol=0;
  ret=(char *)malloc(inl+EVP_CIPHER_CTX_block_size(ctx));
  for (i=0; iinl/100; i++) {
EVP_EncryptUpdate(ctx,ret[ol],tmp,data[ol],100);
ol+=tmp;
  }
  if (inl%100) {
EVP_EncryptUpdate(ctx,ret[ol],tmp,data[ol],inl%100);
ol+=tmp;
  }
  EVP_EncryptFinal(ctx,ret[ol],tmp);
  *rb=ol+tmp;
  return ret;
}

int incremental_encrypt(EVP_CIPHER_CTX *ctx,char *data,int inl)
{
  char *buf;
  int ol;
  int bl=EVP_CIPHER_CTX_block_size(ctx);
  buf=(char *)malloc((inl+bl-1)/bl*bl);
  EVP_EncryptUpdate(ctx,buf,ol,data,inl);
  if (ol) incremental_send(buf,ol);
  free(buf);
  return ol;
}

int incremental_finish(EVP_CIPHER_CTX *ctx)
{
  char *buf;
  int ol;
  buf=(char *)malloc(EVP_CIPHER_CTX_block_size(ctx));
  EVP_EncryptFinal(ctx,buf,ol);
  if (ol) incremental_send(buf,ol);
  free(buf);
  return ol;
}  

char *decrypt_example(EVP_CIPHER_CTX *ctx,char *ct,int inl)
{
  char *pt=(char *)malloc(inl+EVP_CIPHER_CTX_block_size(ctx)+1);
  int ol;
  EVP_DecryptUpdate(ctx,pt,ol,ct,inl);
  if (!ol) {
free(pt);
return NULL;
  }
  pt[ol]=0;
  return pt;
}

int main(int argc,char *argv[])
{
  EVP_CIPHER_CTX ctx;
  char key[EVP_MAX_KEY_LENGTH];
  char iv[EVP_MAX_IV_LENGTH];
  char *ct, *out;
  char final[EVP_MAX_BLOCK_LENGTH];
  char str[]=123456789abcdef;
  int i;
  
  if (!seed_prng(512)) {
printf(ERROR: Unable to seed the PRNG.\n);
abort();
  }
  
  select_random_key(key,EVP_MAX_KEY_LENGTH);
  select_random_iv(iv,EVP_MAX_IV_LENGTH);
  
  EVP_EncryptInit(ctx,EVP_bf_cbc(),key,iv);
  ct=encrypt_example(ctx,str,strlen(str),i);
  printf(Ciphertext: %d bytes\n,i);
  
  EVP_DecryptInit(ctx,EVP_bf_cbc(),key,iv);
  out=decrypt_example(ctx,ct,8);
  printf(Decrypted: %s\n,out);
  

Compiling on a Mac

2008-02-03 Thread Joel Christner
Hi everyone,

I'm having a build issue on a Mac (10.5) that resembles the problem
mentioned on the FAQ page:

http://www.openssl.org/support/faq.html#BUILD9

I searched my HDD for a 'PROBLEMS' file and the only one I found was for
emacs.  Doesn't look like what I need.

The issue I'm seeing is when compiling:

mac# openssl version
OpenSSL 0.9.7l 28 Sep 2006
mac# gcc blowfish.c -o blowfish
...
Undefined symbols:
  _incremental_send, referenced from:
  _incremental_encrypt in ccbqFUEC.o
  _incremental_finish in ccbqFUEC.o
  _EVP_DecryptUpdate, referenced from:
  _decrypt_example in ccbqFUEC.o
  _EVP_EncryptInit, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _EVP_bf_cbc, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _setup_for_decryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _main in ccbqFUEC.o
  _RAND_pseudo_bytes, referenced from:
  _select_random_iv in ccbqFUEC.o
  _EVP_DecryptFinal, referenced from:
  _main in ccbqFUEC.o
  _EVP_EncryptUpdate, referenced from:
  _encrypt_example in ccbqFUEC.o
  _encrypt_example in ccbqFUEC.o
  _incremental_encrypt in ccbqFUEC.o
  _EVP_DecryptInit, referenced from:
  _setup_for_decryption in ccbqFUEC.o
  _main in ccbqFUEC.o
  _RAND_bytes, referenced from:
  _select_random_key in ccbqFUEC.o
  _EVP_EncryptFinal, referenced from:
  _encrypt_example in ccbqFUEC.o
  _incremental_finish in ccbqFUEC.o
  _seed_prng, referenced from:
  _setup_for_encryption in ccbqFUEC.o
  _main in ccbqFUEC.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Does anyone have any pointers or tips on how to rectify this?

Thanks for your help,
Joel


RE: Compiling on a Mac

2008-02-03 Thread David Schwartz


 mac# gcc blowfish.c -o blowfish
 
Where did you get this command from and what was it supposed to accomplish?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-03 Thread Michael Sierchio

Joel Christner wrote:


The issue I'm seeing is when compiling:

mac# openssl version
OpenSSL 0.9.7l 28 Sep 2006
mac# gcc blowfish.c -o blowfish
...
Undefined symbols:


Basic C compiler/linker usage error.

gcc blowfish.c -o blowfish -Llocation of libcrypt.so -lcrypto

or something very much like that.

- M
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Compiling on a Mac

2008-02-03 Thread Joel Christner
blowfish.c is a progam I wrote which contained a series of methods for
initializing, encrypting, and decrypting.

Joel

On Feb 3, 2008 10:51 AM, David Schwartz [EMAIL PROTECTED] wrote:



  mac# gcc blowfish.c -o blowfish

 Where did you get this command from and what was it supposed to
 accomplish?

 DS


 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing Listopenssl-users@openssl.org
 Automated List Manager   [EMAIL PROTECTED]



Re: Problems compiling OpenSSL for Mac OS X Server.

2000-11-29 Thread Richard Levitte - VMS Whacker

From: Mark Morrill [EMAIL PROTECTED]

I'm sorry, but I did respond to that kind of question some time ago.
The problem is, I think no-one in the development team has access to
any MacOS X machine, so checking things out is a bit of a problem.

The error at hand is very easily fixed if there's a way to identify
MacOS X through some C macro.  OpenBSD, for example, is identifiable
through the macro __OpenBSD__.  Is there such a thing for MacOS X?

Please help us find that kind of information, and in turn, we can help
you fix the problem!

Another way to help the development team is to give someone in the
team an account on a MacOS X machine.  The only requirement is that
it's accessible remotely.  I did mention this in my response as well.

mark I asked the same thing some time ago, but didn't get any help :(
mark I've just posted the question on [EMAIL PROTECTED]
mark and [EMAIL PROTECTED].
mark 
mark I'm hoping for better luck from those lists...
mark 
mark If I get any answers, I'll post them here and send them to you.
mark 
mark Mark
mark 
mark 
mark on 11/27/00 15:40, steve stout at [EMAIL PROTECTED] wrote:
mark 
mark  I am trying to compile OpenSSL 0.9.6 on Mac OS X Server 1.2 and I keep
mark  getting the following error when I try to make it.
mark  
mark  /usr/bin/ld: Undefined symbols:
mark  _ftime
mark  make[1]: *** [openssl] Error 1
mark  make: *** [all] Error 1
mark  
mark  
mark  Has anyone successfully compiled OpenSSL for OSX Server 1.2?
mark  If so, please help.

-- 
Richard Levitte   \ Spannvägen 38, II \ [EMAIL PROTECTED]
Chairman@Stacken   \ S-168 35  BROMMA  \ T: +46-8-26 52 47
Redakteur@Stacken   \  SWEDEN   \ or +46-709-50 36 10
Procurator Odiosus Ex Infernis-- [EMAIL PROTECTED]
Member of the OpenSSL development team: http://www.openssl.org/
Software Engineer, Celo Communications: http://www.celocom.com/

Unsolicited commercial email is subject to an archival fee of $400.
See http://www.stacken.kth.se/~levitte/mail/ for more info.
__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: Problems compiling OpenSSL for Mac OS X Server.

2000-11-29 Thread William Garrison

At 10:50 AM +0100 11/29/00, Richard Levitte - VMS Whacker wrote:
From: Mark Morrill [EMAIL PROTECTED]

I'm sorry, but I did respond to that kind of question some time ago.
The problem is, I think no-one in the development team has access to
any MacOS X machine, so checking things out is a bit of a problem.

The error at hand is very easily fixed if there's a way to identify
MacOS X through some C macro.  OpenBSD, for example, is identifiable
through the macro __OpenBSD__.  Is there such a thing for MacOS X?

Please help us find that kind of information, and in turn, we can help
you fix the problem!


I worked through this problem just this week.   There's one line in 
apps/speed.c that needs to have the __APPLE__ macro added to it. 
This isn't the sanctioned macro to use for identifying MacOSX or 
MacOSXServer operating systems, but it is expedient.

In line 90 of speed.c, you need to add " !defined(__APPLE__)" to 
the list of conditionals that determine whether to define the TIMEB 
symbol.

#if defined(__FreeBSD__)
# define USE_TOD
#elif !defined(MSDOS)  (!defined(VMS) || defined(__DECC))
# define TIMES
#endif
#if !defined(_UNICOS)  !defined(__OpenBSD__)  !defined(sgi)  
!defined(__Fr
eeBSD__)  !(defined(__bsdi) || defined(__bsdi__))  !defined(_AIX) 
 !define
d(MPE)  !defined(__APPLE__)
# define TIMEB
#endif

The recommended way to deal with this on Mac OS is to define your 
symbol identifying the OS.  Inventing a symbol like "__MACOSX__", 
make the edit to apps/speed.c described above, substituting 
"__MACOSX__" for "__APPLE__".  Then run config again, with these 
parameters:  ./config no-threads -D__MACOSX__

Hope this helps.  I have OpenSSL 0.9.6 running on my MOSX box, so it 
should work for you too.

Bill

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: Problems compiling OpenSSL for Mac OS X Server.

2000-11-29 Thread Andrew Back

On Wednesday, November 29, 2000, at 02:12 PM, William Garrison wrote:

SNIP>

Hope this helps.  I have OpenSSL 0.9.6 running on my MOSX box, so it 
should work for you too.

OS X PB? Id like to get current OpenSSL, it ships with 0.9.5a. If so how do you get it to build and install in the 'OS X Way', i.e. stuff in Frameworks etc?

Cheers,

Andrew

PS. I'm not a programmer, be gentle..__ OpenSSL Project http://www.openssl.org User Support Mailing List[EMAIL PROTECTED] Automated List Manager   [EMAIL PROTECTED] 

Re: Problems compiling OpenSSL for Mac OS X Server.

2000-11-28 Thread Mark Morrill

Hi Steve,

I asked the same thing some time ago, but didn't get any help :(  I've just
posted the question on [EMAIL PROTECTED] and
[EMAIL PROTECTED].

I'm hoping for better luck from those lists...

If I get any answers, I'll post them here and send them to you.

Mark


on 11/27/00 15:40, steve stout at [EMAIL PROTECTED] wrote:

 I am trying to compile OpenSSL 0.9.6 on Mac OS X Server 1.2 and I keep
 getting the following error when I try to make it.
 
 /usr/bin/ld: Undefined symbols:
 _ftime
 make[1]: *** [openssl] Error 1
 make: *** [all] Error 1
 
 
 Has anyone successfully compiled OpenSSL for OSX Server 1.2?  If so, please
 help.
 
 Thanks!
 
 
 
 s-t-e-v-e--s-t-o-u-t
 web coordinator
 arizona student unions
 52o.626.626o
 
 http://www.union.arizona.edu
 
 
 
 
 
 __
 OpenSSL Project http://www.openssl.org
 User Support Mailing List[EMAIL PROTECTED]
 Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Problems compiling OpenSSL for Mac OS X Server.

2000-11-27 Thread steve stout

I am trying to compile OpenSSL 0.9.6 on Mac OS X Server 1.2 and I keep
getting the following error when I try to make it.

/usr/bin/ld: Undefined symbols:
_ftime
make[1]: *** [openssl] Error 1
make: *** [all] Error 1


Has anyone successfully compiled OpenSSL for OSX Server 1.2?  If so, please
help.

Thanks!



s-t-e-v-e--s-t-o-u-t
web coordinator
arizona student unions
52o.626.626o

http://www.union.arizona.edu





__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Re: Trouble Compiling 0.9.6 on Mac OS X Server

2000-10-17 Thread Aaron Faby


 Did you unpack that in the same spot as an older version of OpenSSL?
 Did you run Configure?

No, and yes

sh config no-idea -fPIC




| Aaron Faby [EMAIL PROTECTED]  |
| Implementation Specialist, PowerSchool, Inc. |
| http://www.powerschool.com   | 
| PowerSchool - Where Education Clicks!|

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]



Trouble Compiling 0.9.6 on Mac OS X Server

2000-10-13 Thread Aaron Faby

Having trouble compiling 0.9.6 on Mac OS X Server, heres the output:

Any suggestions? Thanks in advance!



[aaron:~/Projects/ApacheSSL/openssl-0.9.6] afaby$ make
making all in crypto...
( echo "#ifndef MK1MF_BUILD"; \
echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; 
\
echo "  #define CFLAGS \"cc -DNO_IDEA -fPIC -O3 -DB_ENDIAN\""; \
echo "  #define PLATFORM \"rhapsody-ppc-cc\""; \
echo "  #define DATE \"`date`\""; \
echo "#endif" ) buildinf.h
cc -I. -I../include -DNO_IDEA -fPIC -O3 -DB_ENDIAN   -c cryptlib.c 
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:69: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: illegal expression, found `)'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: illegal expression, found `)'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: illegal expression, found `)'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: illegal expression, found `)'
cryptlib.c:70: undefined type, found `CRYPTO_dynlock'
cryptlib.c:70: illegal expression, found `)'
cryptlib.c:104: "Inconsistency between crypto.h and cryptlib.c"
cryptlib.c:169: undefined type, found `CRYPTO_dynlock'
cryptlib.c:186: illegal expression, found `)'
cryptlib.c:221: undefined type, found `CRYPTO_dynlock'
cryptlib.c:261: undefined type, found `CRYPTO_dynlock'
make[1]: *** [cryptlib.o] Error 1
make: *** [all] Error 1



| Aaron Faby [EMAIL PROTECTED]  |
| Implementation Specialist, PowerSchool, Inc. |
| http://www.powerschool.com   | 
| PowerSchool - Where Education Clicks!|

__
OpenSSL Project http://www.openssl.org
User Support Mailing List[EMAIL PROTECTED]
Automated List Manager   [EMAIL PROTECTED]