--- loncom/LondConnection.pm 2018/12/10 17:34:22 1.59 +++ loncom/LondConnection.pm 2018/12/14 02:05:38 1.62 @@ -1,7 +1,7 @@ # This module defines and implements a class that represents # a connection to a lond daemon. # -# $Id: LondConnection.pm,v 1.59 2018/12/10 17:34:22 raeburn Exp $ +# $Id: LondConnection.pm,v 1.62 2018/12/14 02:05:38 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -176,13 +176,13 @@ host the remote lond is on. This host is =cut sub new { - my ($class, $DnsName, $Port, $lonid, $deflonid) = @_; + my ($class, $DnsName, $Port, $lonid, $deflonid, $loncaparev) = @_; if (!$ConfigRead) { ReadConfig(); $ConfigRead = 1; } - &Debug(4,$class."::new( ".$DnsName.",".$Port.",".$lonid.",".$deflonid.")\n"); + &Debug(4,$class."::new( ".$DnsName.",".$Port.",".$lonid.",".$deflonid.",".$loncaparev.")\n"); my ($conntype,$gotconninfo,$allowinsecure); if ((ref($secureconf{'connto'}) eq 'HASH') && @@ -212,6 +212,7 @@ sub new { my $self = { Host => $DnsName, LoncapaHim => $lonid, LoncapaDefid => $deflonid, + LoncapaRev => $loncaparev, Port => $Port, State => "Initialized", AuthenticationMode => "", @@ -288,15 +289,16 @@ sub new { my ($ca, $cert) = lonssl::CertificateFile; my $sslkeyfile = lonssl::KeyFile; my $badcertfile = lonssl::has_badcert_file($self->{LoncapaHim}); + my ($loncaparev) = ($perlvar{'lonVersion'} =~ /^[\'\"]?([\w.\-]+)[\'\"]?$/); if (($conntype ne 'no') && (defined($ca)) && (defined($cert)) && (defined($sslkeyfile)) && (!exists($badcerts{$self->{LoncapaHim}})) && !$badcertfile) { $self->{AuthenticationMode} = "ssl"; - $self->{TransactionRequest} = "init:ssl:$perlvar{'lonVersion'}\n"; + $self->{TransactionRequest} = "init:ssl:$loncaparev\n"; } elsif ($self->{InsecureOK}) { # Allowed to do insecure: $self->{AuthenticationMode} = "insecure"; - $self->{TransactionRequest} = "init::$perlvar{'lonVersion'}\n"; + $self->{TransactionRequest} = "init::$loncaparev\n"; } else { # Not allowed to do insecure... $socket->close; @@ -1067,6 +1069,7 @@ sub ExchangeKeysViaSSL { my $socket = $self->{Socket}; my $peer = $self->{LoncapaHim}; my $peerdef = $self->{LoncapaDefid}; + my $loncaparev = $self->{LoncapaRev}; # Get our signed certificate, the certificate authority's # certificate and our private key file. All of these @@ -1087,8 +1090,9 @@ sub ExchangeKeysViaSSL { $SSLCertificate, $SSLKey, $peer, - $peerdef, - $CRLFile); + $peerdef, + $CRLFile, + $loncaparev); if(defined $SSLSocket) { my $key = <$SSLSocket>; lonssl::Close($SSLSocket);