Patch: Elm ME+ 2.5 PLalpha54 -> Elm ME+ 2.5 PLalpha60 [6/13] (5/5)
From
Kari Hurtta@21:1/5 to
All on Thu Nov 24 20:27:31 2022
[continued from previous message]
+ struct string * returned_host_name = NULL;
+
+ int r = StreamVerifyName(ra->stream,SS_peer_cn,host_name,
+ & returned_name);
+
+ DPRINT(Debug,8,(&Debug,
+ "remote_account_verify_peer: StreamVerifyName SS_peer_cn host_name=%S",
+ host_name));
+
+ if (returned_name) {
+ DPRINT(Debug,8,(&Debug, " returned_name=%S",
+ returned_name));
+ }
+
+
+ if (r) {
+ DPRINT(Debug,8,(&Debug, " -- succeed (return %d)\n",r));
+
+ } else {
+ SOCKADDR ip_literal;
+
+ DPRINT(Debug,8,(&Debug, " -- failed\n",r));
+
+ if (get_ip(&ip_literal,ra->host)) {
+ DPRINT(Debug,8,(&Debug,
+ "remote_account_verify_peer: %s is ip literal -- no SS_check_host\n",
+ ra->host));
+
+ /* XXXX Need SS_check_ip */
+
+ } else {
+ r = StreamVerifyName(ra->stream,SS_check_host,host_name,
+ & returned_host_name);
+
+ DPRINT(Debug,8,(&Debug,
+ "remote_account_verify_peer: StreamVerifyName SS_check_host host_name=%S",
+ host_name));
+
+ if (returned_host_name) {
+ DPRINT(Debug,8,(&Debug, " returned_host_namename=%S", + returned_host_name));
+ }
+
+ if (r) {
+ DPRINT(Debug,8,(&Debug, " -- succeed (return %d)\n",r));
+ } else {
+ DPRINT(Debug,8,(&Debug, " -- failed\n",r));
+ }
+ }
+ }
+
+ if (! r) {
+ if (returned_name) {
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeRACertCNWrongRequired,
+ "%S %s certificate CN is %S, but %S required."),
+ Server,ra->host,returned_name,
+ host_name);
+ } else {
+ int bits;
+
+ StreamInfo(ra->stream,SS_ssf,&bits,NULL,NULL);
+
+ if (bits > 0)
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeRACertCNRequired,
+ "%S %s certificate CN %S required."), + Server,ra->host,host_name);
+ else
+ lib_error(CATGETS(elm_msg_cat, MeSet,
+ MeRANotEncryptedRequired,
+ "%S %s connection not encrypted, but certificate CN %S required."),
+ Server,ra->host,host_name);
+ }
+ }
+
+ if (returned_host_name)
+ free_string(&returned_host_name);
+ if (returned_name)
+ free_string(&returned_name);
+ if (host_name)
+ free_string(&host_name);
+
+ if (!r) {
+ ret = 0;
+ goto failure;
+ }
+ }
+ }
+
+
+
failure:
DPRINT(Debug,8,(&Debug,"remote_account_verify_peer=%d%s\n",
ret,
--
/ Kari Hurtta
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)