Friday, May 26, 2023

Digest for comp.lang.c++@googlegroups.com - 15 updates in 5 topics

"R.Wieser" <address@is.invalid>: May 26 09:07AM +0200

Paavo,
 
> I'm using a native socket created by the C socket() call.
 
I've got one bit of code using a native socket (ws2_32.dll). But it what I
would like to be able to do without. Just OpenSSL calls - preferrably just
SSL_xxx family calls, but opening a simple native socket using BIO_xxx would
be acceptable (iow : not using the BIO_new_ssl_connect and related ones).
 
> Right. Nobody has said life should be easy ;-)
 
Whut ?! I'm sure I've said that a few times in the past .... :-p
 
> Also, nobody has paid me to prepare code examples which would exactly suit
> your needs.
 
I can't vouch for that, but it is why I started this thread. I can google
snippets of OpenSSL code easily. The problem for me is learning how they
work - so that I have a fighting chance to combine them in new, interresting
ways.
 
Did I already mention that I'm a hobby programmer, who, as part of that
hobby, doesn't have a problem with spending time on trying to figure stuff
out ? Well, I am and I don't. :-)
 
> You just snipped the code which you maybe will try to figure out in the
> future.
 
I just stored the code samples which mention doing that for future use, in
current favor of some of the more basic code samples.
 
Though in this particular case there is a "maybe" involved. There is a good
chance that I will try to keep the whole thing self-contained. On the other
hand, there is also a good chance that I will make the use of that external
storage available depending on a (commandline) setting.
 
> For openssl functions, you can at least just google "man FUNCTIONNAME" to
> get the man page.
 
Thats what I've been pretty-much doing, and finding stuff like
 
https://www.openssl.org/docs/man1.1.1/man3/SSL_connect.html
 
That site seems to be a nice source for function reference. But just take a
look at the difference of information between the blocking and non-blocking
usage (remember that I mentioned that I'm using, for starters,using the
simpler "blocking" mode ?).
 
Another one :
 
https://www.openssl.org/docs/manmaster/man3/SSL_set_fd.html
 
Its good enough when you want to look up something (looking back), but isn't
as good when you need a usage explanation (looking forward).
 
Ahhh.... I already wondered why I have been using SSL_set_fd and BIO_get_fd
(digging down to the native socket), while not having seen anything which
loads the BIO directly into the SSL context.
 
It turns out that that function actually exists : SSL_set_bio. Now all I
have to do is to spend (heaps of) time googeling for that function, in the
hope I can find some code using it (showing how the BIO needs to be
created).
 
> Of course, it does not help openssl contains hundreds of functions, half
> of which are deprecated, and half of which are not needed for the task at
> hand.
 
:-) You noticed. ssleay32.dll has (just) 206. libeay32.dll has a whopping
2953 of them.
 
Yeah, thats part of the problem I'm having with OpenSSL. It seems to have
multiple ways of reaching the same goal (take BIO_read and SSL_read. No
real idea when either is (in)valid to use), and than finding examples which
mix the different methods does not help me in getting the big picture. :-|
 
> If one feels uncomfortable with raw sockets
 
I've got no problem with that (see below).
 
> and raw openssl,
 
And that is what I would like to do - but *not* mixing raw sockets up with
"raw" OpenSSL.
 
Although I have code available which does all of the "raw" / native socket
handling (parsing the host : port combination, resolving the host to an IP,
connecting to that IP and port), I cannot escape the feeling that
/somewhere/ in that humongous ammount of ssleay32 and libay32 functions
there must be functions which offer the same - but than in a simpler
package.
 
Actually, BIO_set_conn_hostname does the parsing just fine, but not at the
level I would like to see it happening (using the SSL_xxx environment).
 
By the way : I posted here because this is where I expected the most chance
of getting a "low level" answer (the "comp.lang.c" newsgroup seems to have
been poisonned by spammers). I'm actually using an Assembler (Borlands
Tasm32), which goes even lower than that. :-)
 
Regards,
Rudy Wieser
Paavo Helde <eesnimi@osa.pri.ee>: May 26 11:35PM +0300

26.05.2023 10:07 R.Wieser kirjutas:
 
> snippets of OpenSSL code easily. The problem for me is learning how they
> work - so that I have a fighting chance to combine them in new, interresting
> ways.
 
Suggesting you to post these questions to the openssl-users@openssl.org
mailing list (subscribe at
https://mta.openssl.org/mailman/listinfo/openssl-users), there are
people who know infinitely more about openssl than myself. If your use
case is not the exact same than mine then I'm afraid I can not be of
much help.
Vir Campestris <vir.campestris@invalid.invalid>: May 26 08:49PM +0100

On 23/05/2023 15:51, Scott Lurndal wrote:
> drive and the disk controller, allowing eight controllers to
> simultaneously transfer data to/from memory (interleaved with
> processor accesses to the same memory).
 
My experience was ICL 2900s, and AIUI they could have multiple memory
subsystems. Moving data between them was something we did our ****est to
avoid.
 
Andy
"james...@alumni.caltech.edu" <jameskuyper@alumni.caltech.edu>: May 26 12:49AM -0700

> "james...@alumni.caltech.edu" <james...@alumni.caltech.edu> wrote:
> >On Wednesday, May 24, 2023 at 4:51:07=E2=80=AFAM UTC-4, Mut...@dastardlyhq.=
> >com wrote:
...
> cut and pasted properly but it still failed.
 
> However this wouldn't be the first time the Apple version of Clang differs
> from versions on other platforms.
 
Something about that error message makes me suspicious that the
problem may be more fundamental. Does it still complain if you change it
to use a raw pointer, rather than a shared_pointer?:
 
mystruct(*sp)[3](new mystruct[1][3]);
...
for(auto &ms: sp[0]) ms.func();
...
delete[] sp;
Muttley@dastardlyhq.com: May 26 08:44AM

On Fri, 26 May 2023 00:49:32 -0700 (PDT)
>for(auto &ms: sp[0]) ms.func();
>....
>delete[] sp;
 
No, that compiles fine. Looks like the current Mac version of Clang does
have a bug but given how infrequently Apple updates their compiler I won't
hold my breath on it being fixed anytime soon.
Bonita Montero <Bonita.Montero@gmail.com>: May 26 01:14PM +0200


> No, that compiles fine. Looks like the current Mac version of Clang does
> have a bug but given how infrequently Apple updates their compiler I won't
> hold my breath on it being fixed anytime soon.
 
AFAIK you can replace Apple's clang with LLVM clang somhehow.
"Öö Tiib" <ootiib@hot.ee>: May 26 05:59AM -0700

On Friday, 26 May 2023 at 14:16:10 UTC+3, Bonita Montero wrote:
> > have a bug but given how infrequently Apple updates their compiler I won't
> > hold my breath on it being fixed anytime soon.
> AFAIK you can replace Apple's clang with LLVM clang somhehow.
 
Yes, <https://releases.llvm.org/> can download distributions for Apple too.
Muttley@dastardlyhq.com: May 26 03:00PM

On Fri, 26 May 2023 05:59:02 -0700 (PDT)
 
>> > hold my breath on it being fixed anytime soon.
>> AFAIK you can replace Apple's clang with LLVM clang somhehow.
 
>Yes, <https://releases.llvm.org/> can download distributions for Apple too.
 
Every new release of MacOS locks things down more and more. I'm a bit
paranoid about updating something as fundamental as the compiler and all
the libraries as I have a nasty feeling things might die halfway through with
some system integrity or unsigned code error or similar.
Bonita Montero <Bonita.Montero@gmail.com>: May 26 07:20PM +0200

> paranoid about updating something as fundamental as the compiler and
> all the libraries as I have a nasty feeling things might die halfway
> through with some system integrity or unsigned code error or similar.
 
I think a compiler is much more fundamental for Linux than for macOS.
Muttley@dastardlyhq.com: May 26 08:40AM

On Thu, 25 May 2023 20:49:28 +0200
>highly knowledgeable and totally naïve. They need patient teachers and
>"parents", working with them for many years at least, and no one is
>willing to wait for that.
 
Sure, but like a lot of people you're missing the point. It doesn't matter
if the data its trained on is out of date or just pure rubbish, its the fact
that it somehow comprehends it and can make links between unrelated topics.
 
Plenty of very smart people in the past have argued about how many angels
can fit on the head of a pin because of the nonsense in religious story books,
that doesn't mean they're thick.
Muttley@dastardlyhq.com: May 26 08:42AM

On Thu, 25 May 2023 20:58:41 +0200
>But it appears to have been done by making up a poem about C++ in modern
>English (no mean feat in itself), then translating word for word where
>the system could find a Middle English equivalent (with no regard for
 
The fact that it can do it at all is amazing to me.
 
>can understand most of the poem. But if you look up some Chaucer or
>other real Middle English poetry, I doubt you'll have much idea at all
>about what it is saying - at least not without a lot of effort.
 
Chaucer can be understandable , often its a modern word spelt in an old
way. Old English OTOH is a completely different language and is about as
comprehensible as German for any modern english speaker.
David Brown <david.brown@hesbynett.no>: May 26 02:38PM +0200


> Sure, but like a lot of people you're missing the point. It doesn't matter
> if the data its trained on is out of date or just pure rubbish, its the fact
> that it somehow comprehends it and can make links between unrelated topics.
 
Again - I am not missing anything. I understand what you are saying,
and I am impressed with what it is able to do. But precisely because it
is trained on data that is out of date, wrong, or deliberate
misinformation as much as current and correct information, the
conclusions it reaches and links it makes are often worthless, or worse
than useless (because they contain critical errors, but are given with
such confidence and mixed with true statements).
 
> Plenty of very smart people in the past have argued about how many angels
> can fit on the head of a pin because of the nonsense in religious story books,
> that doesn't mean they're thick.
 
The fact that human knowledge and human intelligence do not always match
up does not have any bearing on how useful chatbot-style AI currently
is, or how dangerous it can be, or where its future might lie. Humans
can get things wrong too, intentionally or unintentionally - that does
not make the AI systems less wrong.
David Brown <david.brown@hesbynett.no>: May 26 03:30PM +0200

>> English (no mean feat in itself), then translating word for word where
>> the system could find a Middle English equivalent (with no regard for
 
> The fact that it can do it at all is amazing to me.
 
I fully agree.
 
 
> Chaucer can be understandable , often its a modern word spelt in an old
> way. Old English OTOH is a completely different language and is about as
> comprehensible as German for any modern english speaker.
 
Some Middle English is understandable, other parts are not - often the
context and culture differences are as much of a challenge as the words
themselves. But it is clear that Middle English is a precursor to
modern English, whereas Old English, or Anglo-Saxon, is very different.
Muttley@dastardlyhq.com: May 26 03:07PM

On Fri, 26 May 2023 15:30:58 +0200
>context and culture differences are as much of a challenge as the words
>themselves. But it is clear that Middle English is a precursor to
>modern English, whereas Old English, or Anglo-Saxon, is very different.
 
Anglo Saxon is to modern english what latin is to french, italian, spanish
etc. Obviously related and with shared words but not generally intelligable
to a modern romance language speaker.
David Dalton <dalton@nfld.com>: May 26 04:43AM -0230

cODINg :-)
 
--
https://www.nfld.com/~dalton/dtales.html Salmon on the Thorns (mystic page)
"This could be the final breath; This is life and death;
This is hard rock and water; Out here between wind and flame;
Between tears and elation; Lies a secret nation" (Ron Hynes)
You received this digest because you're subscribed to updates for this group. You can change your settings on the group membership page.
To unsubscribe from this group and stop receiving emails from it send an email to comp.lang.c+++unsubscribe@googlegroups.com.

No comments: