[squeak-dev] The Trunk: Network-ul.218.mcz

commits at source.squeak.org commits at source.squeak.org
Mon Feb 5 20:19:15 UTC 2018


Levente Uzonyi uploaded a new version of Network to project The Trunk:
http://source.squeak.org/trunk/Network-ul.218.mcz

==================== Summary ====================

Name: Network-ul.218
Author: ul
Time: 5 February 2018, 9:19:11.648759 pm
UUID: 926b8c34-1b27-4979-bef7-4b9533613743
Ancestors: Network-tpr.217

- after upgrading to TLS, the session has to be reinitiated in SMTPClient
- use #base64Encoded in Authorizer>>encode:password:

=============== Diff against Network-tpr.217 ===============

Item was changed:
  ----- Method: Authorizer>>encode:password: (in category 'authentication') -----
  encode: nameString password: pwdString
  	"Encode per RFC1421 of the username:password combination."
  
+ 	^(nameString, ':', pwdString) base64Encoded!
- 	| clear code clearSize idx map |
- 	clear := (nameString, ':', pwdString) asByteArray.
- 	clearSize := clear size.
- 	[ clear size \\ 3 ~= 0 ] whileTrue: [ clear := clear, #(0) ].
- 	idx := 1.
- 	map := 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.
- 	code := WriteStream on: ''.
- 	[ idx < clear size ] whileTrue: [ code 
- 		nextPut: (map at: (clear at: idx) // 4 + 1);
- 		nextPut: (map at: (clear at: idx) \\ 4 * 16 + ((clear at: idx + 1) // 16) + 1);
-    		nextPut: (map at: (clear at: idx + 1) \\ 16 * 4 + ((clear at: idx + 2) // 64) + 1);
-    		nextPut: (map at: (clear at: idx + 2) \\ 64 + 1).
- 		idx := idx + 3 ].
- 	code := code contents.
- 	idx := code size.
- 	clear size - clearSize timesRepeat: [ code at: idx put: $=. idx := idx - 1].
- 	^code!

Item was changed:
  ----- Method: SMTPClient>>initiateSession (in category 'private protocol') -----
  initiateSession
  	"EHLO <SP> <domain> <CRLF>"
  
  	self sendCommand: (self useHelo ifTrue:['HELO '] ifFalse: ['EHLO ']) , self localHostName.
  	self checkResponse.
  	
  	self parseCapabilities: (self lastResponse lines allButFirst 
  			collect: [:l | self valueOfResponseLine: l]).
  
  	(self tlsIsActive not and: [self serverSupportsStarttls] and: [self wantsStarttls])
+ 		ifTrue: [
+ 			self starttls.
+ 			self responseIsSuccess ifTrue: [
+ 				self initiateSession ] ]!
- 		ifTrue: [self starttls]!



More information about the Squeak-dev mailing list