Index: client/1.0/pkgr.eagle ================================================================== --- client/1.0/pkgr.eagle +++ client/1.0/pkgr.eagle @@ -173,16 +173,17 @@ } } # # NOTE: This procedure returns non-zero if the specified string value - # looks like a Harpy (script) certificate. The value argument - # is the string to check. The value 14 used within this procedure - # is the length of the literal string "". + # looks like a Harpy (script) certificate. The value argument is + # the string to check. The value 14 used within this procedure is + # the length of the literal string "". # # proc isHarpyCertificate { value } { + set value [string trim $value] set length [string length $value] if {$length == 0 || ([string first [string trim { }] $value] == 0 && [string first [string trim { @@ -196,25 +197,24 @@ } } # # NOTE: This procedure returns non-zero if the specified string value - # looks like an OpenPGP signature. The value argument is the - # string to check. The value 29 used within this procedure is - # the length of the literal string "-----END PGP SIGNATURE-----" - # followed by a carriage-return / line-feed pair, which means - # the value must be in DOS format. + # looks like an OpenPGP signature. The value argument is the string + # to check. The value 27 used within this procedure is the length + # of the literal string "-----END PGP SIGNATURE-----". # # proc isPgpSignature { value } { + set value [string trim $value] set length [string length $value] if {$length == 0 || ([string first [string trim { -----BEGIN PGP SIGNATURE----- - }] $value] == 0 && [string first [subst [string trim { - -----END PGP SIGNATURE-----\r\n - }]] $value] == ($length - 29))} then { + }] $value] == 0 && [string first [string trim { + -----END PGP SIGNATURE----- + }] $value] == ($length - 27))} then { return true } else { return false } }