How to access the IP/Ethernet addresses using OpenSSL

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

How to access the IP/Ethernet addresses using OpenSSL

kashif javed-2
Dear,

I am developing an application on my RedHat Linux 9.0
system using its default OpenSSL 0.9.7, can you please
help me understand how can i access the IP addresses
of both the source and destination nodes on
application layer? Also how can i access the Hardware
addresses or Ethernet addresses of both source and
destination(to whom we forward the packets)?

Regards,

Kashif

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: How to access the IP/Ethernet addresses using OpenSSL

Kyle Hamilton
In OpenSSL, you can get the underlying socket descriptor (using int
SSL_get_fd(const SSL *ssl)) and then call getpeername() on that
descriptor.

Accessing the hardware addresses is very system-specific.  It
generally involves looking into the ARP cache, and making sure you're
on the same subnet as the peer.

-Kyle H

On 3/5/06, kashif javed <[hidden email]> wrote:

> Dear,
>
> I am developing an application on my RedHat Linux 9.0
> system using its default OpenSSL 0.9.7, can you please
> help me understand how can i access the IP addresses
> of both the source and destination nodes on
> application layer? Also how can i access the Hardware
> addresses or Ethernet addresses of both source and
> destination(to whom we forward the packets)?
>
> Regards,
>
> Kashif
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    [hidden email]
> Automated List Manager                           [hidden email]
>
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: How to access the IP/Ethernet addresses using OpenSSL

kashif javed-2
Dear Kyle,

Thanks for your reply.
As mentioned in my email follow that i am using RedHat
Linux 9.0, so can you please help me in accessing the
Ethernet addresses using OpenSSL on the application
layer. Besides OS, let me inform you that i am have a
LAN of 6 nodes.

Regards,

Kashif

--- Kyle Hamilton <[hidden email]> wrote:

> In OpenSSL, you can get the underlying socket
> descriptor (using int
> SSL_get_fd(const SSL *ssl)) and then call
> getpeername() on that
> descriptor.
>
> Accessing the hardware addresses is very
> system-specific.  It
> generally involves looking into the ARP cache, and
> making sure you're
> on the same subnet as the peer.
>
> -Kyle H
>
> On 3/5/06, kashif javed <[hidden email]> wrote:
> > Dear,
> >
> > I am developing an application on my RedHat Linux
> 9.0
> > system using its default OpenSSL 0.9.7, can you
> please
> > help me understand how can i access the IP
> addresses
> > of both the source and destination nodes on
> > application layer? Also how can i access the
> Hardware
> > addresses or Ethernet addresses of both source and
> > destination(to whom we forward the packets)?
> >
> > Regards,
> >
> > Kashif
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam
> protection around
> > http://mail.yahoo.com
> >
>
______________________________________________________________________
> > OpenSSL Project                                
> http://www.openssl.org
> > User Support Mailing List                  
> [hidden email]
> > Automated List Manager                          
> [hidden email]
> >
>
______________________________________________________________________
> OpenSSL Project                                
> http://www.openssl.org
> User Support Mailing List                  
> [hidden email]
> Automated List Manager                          
> [hidden email]
>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: How to access the IP/Ethernet addresses using OpenSSL

Chen Talos
In reply to this post by Kyle Hamilton

I think functions about ARP and RARP would help. I know how to do this under Windows, but I have no idea about such things under *nix.




Talos Chen, 22

Shanghai, China

[hidden email]


From: "Kyle Hamilton" <[hidden email]>
Reply-To: [hidden email]
To: [hidden email]
Subject: Re: How to access the IP/Ethernet addresses using OpenSSL
Date: Sun, 5 Mar 2006 17:18:32 -0700

>In OpenSSL, you can get the underlying socket descriptor (using int
>SSL_get_fd(const SSL *ssl)) and then call getpeername() on that
>descriptor.
>
>Accessing the hardware addresses is very system-specific. It
>generally involves looking into the ARP cache, and making sure you're
>on the same subnet as the peer.
>
>-Kyle H
>
>On 3/5/06, kashif javed <[hidden email]> wrote:
> > Dear,
> >
> > I am developing an application on my RedHat Linux 9.0
> > system using its default OpenSSL 0.9.7, can you please
> > help me understand how can i access the IP addresses
> > of both the source and destination nodes on
> > application layer? Also how can i access the Hardware
> > addresses or Ethernet addresses of both source and
> > destination(to whom we forward the packets)?
> >
> > Regards,
> >
> > Kashif
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> > ______________________________________________________________________
> > OpenSSL Project http://www.openssl.org
> > User Support Mailing List [hidden email]
> > Automated List Manager [hidden email]
> >
>______________________________________________________________________
>OpenSSL Project http://www.openssl.org
>User Support Mailing List [hidden email]
>Automated List Manager [hidden email]


免费下 载 MSN Explorer Get 2 months FREE*. ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [hidden email] Automated List Manager [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: How to access the IP/Ethernet addresses using OpenSSL

Rick Jones-2
In reply to this post by kashif javed-2
So, from SSL you can find the socket and thence the IP, and in theory
you can use things like the ARP ioctls to _try_ to find the MAC (eg
Ethernet) address - however that last part only really works when all
the systems are in the same broadcast domain.  If they are on the other
side of a router or routers you will not be able to get the remote
system's MAC address - the MAC address is not "end-to-end" in an
internet or intranet, only in a LAN.

So, if you are relying on finding the remote's MAC address, you are
basically by definition limiting your application to a LAN.

rick jones
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [hidden email]
Automated List Manager                           [hidden email]