Re: [openssl-users] Where to find definitions of certain functions

2016-10-17 Thread Ajay Garg
I guess we need to look at OpenWrt for MIPS-versions of the libraries.

We do have a device running on MIPS, and linking the OpenWrt-versions of
libcrypto.a and libssl.a (with our framework-binary) works like a charm.


Thanks and Regards,
Ajay

On Mon, Oct 17, 2016 at 7:30 PM, craig_we...@trendmicro.com <
craig_we...@trendmicro.com> wrote:

> I’m interested in the rest of this story.  Does compiling a separate
> library for linking work for you now?  Our product runs on two platforms:
> one Pentium-based and one Mips-based. The Pentium build works fine but the
> Mips build fails at link time with unresolved function references.
>
>
>
> *From:* openssl-users [mailto:openssl-users-boun...@openssl.org] *On
> Behalf Of *Ajay Garg
> *Sent:* Sunday, October 16, 2016 10:16 PM
> *To:* openssl-users@openssl.org
> *Subject:* Re: [openssl-users] Where to find definitions of certain
> functions
>
>
>
> Aah... I guess I was being an idiot.
>
> I just realize that the recommended/best/easier way is to compile openssl
> as a separate library (enabling/disabling/removing features as required),
> and then link this library to our application-binary.
>
> Thanks a ton Salz, you have saved me a LOT of hours :)
>
> Thanks and Regards,
>
> Ajay
>
>
>
> On Sun, Oct 16, 2016 at 10:09 PM, Salz, Rich <rs...@akamai.com> wrote:
>
>
> > Also, I am not using Makefiles, rather compiling each "c unit" using gcc
> using first-principles.
> > Could that be an issue?
>
> Probably.
>
> Only "make" is supported.  You are on your own.
>
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>
>
>
>
> --
>
> Regards,
> Ajay
>
> TREND MICRO EMAIL NOTICE
> The information contained in this email and any attachments is confidential
> and may be subject to copyright or other intellectual property protection.
> If you are not the intended recipient, you are not authorized to use or
> disclose this information, and we request that you notify us by reply mail or
> telephone and delete the original message from your mail system.
>
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>
>


-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-17 Thread craig_we...@trendmicro.com
I’m interested in the rest of this story.  Does compiling a separate library 
for linking work for you now?  Our product runs on two platforms: one 
Pentium-based and one Mips-based. The Pentium build works fine but the Mips 
build fails at link time with unresolved function references.

From: openssl-users [mailto:openssl-users-boun...@openssl.org] On Behalf Of 
Ajay Garg
Sent: Sunday, October 16, 2016 10:16 PM
To: openssl-users@openssl.org
Subject: Re: [openssl-users] Where to find definitions of certain functions

Aah... I guess I was being an idiot.
I just realize that the recommended/best/easier way is to compile openssl as a 
separate library (enabling/disabling/removing features as required), and then 
link this library to our application-binary.

Thanks a ton Salz, you have saved me a LOT of hours :)

Thanks and Regards,
Ajay

On Sun, Oct 16, 2016 at 10:09 PM, Salz, Rich 
<rs...@akamai.com<mailto:rs...@akamai.com>> wrote:

> Also, I am not using Makefiles, rather compiling each "c unit" using gcc 
> using first-principles.
> Could that be an issue?

Probably.

Only "make" is supported.  You are on your own.

--
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users



--
Regards,
Ajay


TREND MICRO EMAIL NOTICE
The information contained in this email and any attachments is confidential 
and may be subject to copyright or other intellectual property protection. 
If you are not the intended recipient, you are not authorized to use or 
disclose this information, and we request that you notify us by reply mail or
telephone and delete the original message from your mail system.
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-16 Thread Ajay Garg
Aah... I guess I was being an idiot.

I just realize that the recommended/best/easier way is to compile openssl
as a separate library (enabling/disabling/removing features as required),
and then link this library to our application-binary.


Thanks a ton Salz, you have saved me a LOT of hours :)


Thanks and Regards,
Ajay

On Sun, Oct 16, 2016 at 10:09 PM, Salz, Rich  wrote:

>
> > Also, I am not using Makefiles, rather compiling each "c unit" using gcc
> using first-principles.
> > Could that be an issue?
>
> Probably.
>
> Only "make" is supported.  You are on your own.
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>



-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-16 Thread Salz, Rich

> Also, I am not using Makefiles, rather compiling each "c unit" using gcc 
> using first-principles.
> Could that be an issue?

Probably.

Only "make" is supported.  You are on your own.

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-16 Thread Ajay Garg
I am bringing in the relevant sources from the cloned openssl-repository,
and comping each "c unit" separately.
Also, I am not using Makefiles, rather compiling each "c unit" using gcc
using first-principles.

Could that be an issue?

On Sun, Oct 16, 2016 at 8:10 PM, Salz, Rich  wrote:

> > ex_data.c:(.text+0xaa6): undefined reference to `sk_num'
>
> Something seems wrong in your build environment.  Make sure you are
> starting with a completely empty build tree.
> -rich salz
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>



-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-16 Thread Salz, Rich
> ex_data.c:(.text+0xaa6): undefined reference to `sk_num'

Something seems wrong in your build environment.  Make sure you are starting 
with a completely empty build tree.
-rich salz

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-16 Thread Ajay Garg
Thanks Salz.

I get a lot of linking-errors like ::

ex_data.c:(.text+0xaa6): undefined reference to `sk_num'
ex_data.c:(.text+0xb06): undefined reference to `sk_value'
ex_data.c:(.text+0xc5e): undefined reference to `sk_free'


Doing,



*nm -o /usr/lib/i386-linux-gnu/libssl.a | grep
sk_num*/usr/lib/i386-linux-gnu/libssl.a:s3_srvr.o:
U sk_num
/usr/lib/i386-linux-gnu/libssl.a:s3_clnt.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:s3_lib.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:s23_clnt.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:t1_lib.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:d1_srtp.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:ssl_lib.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:ssl_cert.o: U sk_num
/usr/lib/i386-linux-gnu/libssl.a:ssl_ciph.o: U sk_num


Now, if I see, for example in "openssl/ssl/s3_clnt.c", I do not get any
strings for "sk_num", but I do get the strings of the form
"sk_SSL_COMP_num".


Also, I tried doing the following, but could not see any correlation :



*grep -r "define SSL_COMP"
~/openssl/openssl/*/home/ajay/openssl/openssl/crypto/symhacks.h:#
define SSL_COMP_get_compression_methodsSSL_COMP_get_compress_methods
/home/ajay/openssl/openssl/crypto/symhacks.h:#  define
SSL_COMP_set0_compression_methods   SSL_COMP_set0_compress_methods
/home/ajay/openssl/openssl/crypto/symhacks.h:#  define
SSL_COMP_free_compression_methods   SSL_COMP_free_compress_methods
/home/ajay/openssl/openssl/ssl/ssl_ciph.c:#define SSL_COMP_NULL_IDX   0
/home/ajay/openssl/openssl/ssl/ssl_ciph.c:#define SSL_COMP_ZLIB_IDX   1
/home/ajay/openssl/openssl/ssl/ssl_ciph.c:#define SSL_COMP_NUM_IDX2



What's this mystery?



On Sat, Oct 15, 2016 at 10:55 PM, Salz, Rich  wrote:

> > Hardly helps :(
>
> ➢ /usr/lib/i386-linux-gnu/libcrypto.a:a_time.o:0230 T
> ASN1_TIME_to_generalizedtime
>
> Sure it does.  You know it's in a_time.c, which is crypto/asn1/a_time.c
> And if you look in that file you see "IMPLEMENT_ASN1_FJUNCTIONS" with an
> ASN1_TIME argument.  So, start digging.
>
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>



-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-15 Thread Salz, Rich
> Hardly helps :(

➢ /usr/lib/i386-linux-gnu/libcrypto.a:a_time.o:0230 T 
ASN1_TIME_to_generalizedtime

Sure it does.  You know it's in a_time.c, which is crypto/asn1/a_time.c  And if 
you look in that file you see "IMPLEMENT_ASN1_FJUNCTIONS" with an ASN1_TIME 
argument.  So, start digging.


-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-15 Thread Ajay Garg
Hardly helps :(

*nm -o /usr/lib/i386-linux-gnu/libcrypto.a  | grep ASN1_TIME_t*
nm: ebcdic.o: no symbols
/usr/lib/i386-linux-gnu/libcrypto.a:a_time.o:0230 T
ASN1_TIME_to_generalizedtime
/usr/lib/i386-linux-gnu/libcrypto.a:ocsp_srv.o: U
ASN1_TIME_to_generalizedtime

On Sat, Oct 15, 2016 at 9:08 PM, Salz, Rich  wrote:

> > grep -r ASN1_TIME\( ~/openssl/openssl/
> > /home/ajay/openssl/openssl/crypto/asn1/a_time.c:int
> i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp)
>
> > How to search for such symbols in the cloned source-code?
>
> Much of the ASN1 data structures are created by macros and it will not be
> immediately obvious to newcomers how it works.
>
> Your best bet is to use "nm -o" on the library and find the file, and then
> work backward from there.
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>



-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-15 Thread Salz, Rich
> grep -r ASN1_TIME\( ~/openssl/openssl/
> /home/ajay/openssl/openssl/crypto/asn1/a_time.c:int i2d_ASN1_TIME(ASN1_TIME 
> *a, unsigned char **pp)

> How to search for such symbols in the cloned source-code?

Much of the ASN1 data structures are created by macros and it will not be 
immediately obvious to newcomers how it works.

Your best bet is to use "nm -o" on the library and find the file, and then work 
backward from there.

-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-15 Thread Ajay Garg
Thanks Matt.


That helped.


However, I am now searching for symbols like ASN_TIME_it, but I get nothing
useful ::

*grep -r ASN1_TIME_it ~/openssl/openssl/*
/home/ajay/openssl/openssl/util/libeay.num:ASN1_TIME_it2715
EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
/home/ajay/openssl/openssl/util/libeay.num:ASN1_TIME_it2715
EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:

*grep -r ASN1_TIME\( ~/openssl/openssl/*
/home/ajay/openssl/openssl/crypto/asn1/a_time.c:int i2d_ASN1_TIME(ASN1_TIME
*a, unsigned char **pp)


How to search for such symbols in the cloned source-code?

On Sat, Oct 15, 2016 at 6:20 PM, Matt Caswell  wrote:

>
>
> On 15/10/16 13:43, Ajay Garg wrote:
> > Hi All.
> >
> > I plan to integrate openssl in our client-side-framework, so that we can
> > remove all the unneeded stuff (as the TLS-versions, and
> > certificate-management is controlled by the server only, which is only a
> > limited subset amongst the vast feature-set of openssl).
> >
> > As part of this, I am first bringing in *all* code into our framework,
> > to the extent that the code compiles as the first stage.
> > My progress is going mostly fine, however I am stuck as I am unable to
> > retrieve the definitions of certain symbols (macros I guess), such as ::
> >
> >   ASN1_OCTET_STRING_free
> >   ASN1_OCTET_STRING_new
> >
> >
> > There are others too, but I guess that if I can be known how to retrieve
> > the above definitions, then others will follow similarly.
> > So, will be grateful to hear from you experts :)
>
> See:
>
> https://github.com/openssl/openssl/blob/master/crypto/asn1/tasn_typ.c
>
> Matt
>
>
> --
> openssl-users mailing list
> To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users
>



-- 
Regards,
Ajay
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] Where to find definitions of certain functions

2016-10-15 Thread Matt Caswell


On 15/10/16 13:43, Ajay Garg wrote:
> Hi All.
> 
> I plan to integrate openssl in our client-side-framework, so that we can
> remove all the unneeded stuff (as the TLS-versions, and
> certificate-management is controlled by the server only, which is only a
> limited subset amongst the vast feature-set of openssl).
> 
> As part of this, I am first bringing in *all* code into our framework,
> to the extent that the code compiles as the first stage.
> My progress is going mostly fine, however I am stuck as I am unable to
> retrieve the definitions of certain symbols (macros I guess), such as ::
> 
>   ASN1_OCTET_STRING_free
>   ASN1_OCTET_STRING_new
> 
> 
> There are others too, but I guess that if I can be known how to retrieve
> the above definitions, then others will follow similarly.
> So, will be grateful to hear from you experts :)

See:

https://github.com/openssl/openssl/blob/master/crypto/asn1/tasn_typ.c

Matt


-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users