[Tkabber-dev] r2109 - in trunk/tkabber-plugins: . otr/tclotr

tkabber-svn at jabber.ru tkabber-svn at jabber.ru
Mon Jan 27 12:44:32 MSK 2014


Author: sergei
Date: 2014-01-27 12:44:32 +0400 (Mon, 27 Jan 2014)
New Revision: 2109

Modified:
   trunk/tkabber-plugins/ChangeLog
   trunk/tkabber-plugins/otr/tclotr/key.tcl
Log:
	* otr/tclotr/key.tcl: Use unix line endings when exporting the DSA
	  private key.


Modified: trunk/tkabber-plugins/ChangeLog
===================================================================
--- trunk/tkabber-plugins/ChangeLog	2014-01-27 06:54:09 UTC (rev 2108)
+++ trunk/tkabber-plugins/ChangeLog	2014-01-27 08:44:32 UTC (rev 2109)
@@ -10,8 +10,11 @@
 
 	* otr/key.tcl: Show dialog if importing DSA key fails.
 
-	* otr/tclotr/otr.key: Fixed typo.
+	* otr/tclotr/key.tcl: Fixed typo.
 
+	* otr/tclotr/key.tcl: Use unix line endings when exporting the DSA
+	  private key.
+
 2014-01-26  Sergei Golovan <sgolovan at nes.ru>
 
 	* otr/tclotr/otr.tcl: Fixed refreshing private connection if the

Modified: trunk/tkabber-plugins/otr/tclotr/key.tcl
===================================================================
--- trunk/tkabber-plugins/otr/tclotr/key.tcl	2014-01-27 06:54:09 UTC (rev 2108)
+++ trunk/tkabber-plugins/otr/tclotr/key.tcl	2014-01-27 08:44:32 UTC (rev 2109)
@@ -82,6 +82,11 @@
     set y [::math::bignum::tostr $by]
     ::asn::asnGetBigInteger sequence bx
     set x [::math::bignum::tostr $bx]
+    if {[::otr::crypto::BitLength $p] != 1024 &&
+                    [::otr::crypto::BitLength $q] != 160} {
+        return -code error \
+               "Unsupported DSA private key length, must be 1024 bit"
+    }
     list $p $q $g $y $x
 }
 
@@ -119,7 +124,7 @@
 #       Error may be raised if the file can't be written.
 
 proc ::otr::key::writePEM {key filename} {
-    set fd [open $filename w]
+    set fd [open $filename wb]
     set data [encodePEM $key]
     puts $fd $data
     close $fd



More information about the Tkabber-dev mailing list