OSDN Git Service

refs #19657
authorh677 <h677>
Mon, 23 Nov 2009 13:12:49 +0000 (13:12 +0000)
committerh677 <h677>
Mon, 23 Nov 2009 13:12:49 +0000 (13:12 +0000)
生キー指定の際に、16進コードのアルファベット部分を変換できない不具合の修正

Trip.pas

index 3f6a501..bf31577 100644 (file)
--- a/Trip.pas
+++ b/Trip.pas
@@ -435,7 +435,7 @@ begin
             if (Pos(pw[2*i + 0 + 1], '0123456789abcdefABCDEF') > 0) and
                 (Pos(pw[2*i + 1 + 1], '0123456789abcdefABCDEF') > 0) then begin
                 convpw := convpw +
-                    Char(StrToInt( pw[2*i + 0 + 1] ) shl 4 + StrToInt( pw[2*i + 1 + 1] ));
+                    Char(StrToInt( 'x' + pw[2*i + 0 + 1] ) shl 4 + StrToInt( 'x'  + pw[2*i + 1 + 1] ));
             end else begin
                 convpw := '';
                 Break;
@@ -498,7 +498,10 @@ begin
             if pw[ 0 ] = '#' then begin
                 get_pw_salt(pw, convpw, salt);
             end;
-            if Length(convpw) = 8 then begin
+            if (pw[ 0 ] = '#') and (Length(pw) >= 12) then begin
+                // \8f«\97\88\82Ì\8ag\92£\97p
+                Result := '???';
+            end else if Length(convpw) = 8 then begin
                 Result := Copy( crypt_r( PChar(convpw), salt, s ), 4, 100 );
             end else begin
                 // \90V\95û\8e®