소스 검색

Merge #8858: rpc: Generate auth cookie in hex instead of base64

1c80386 rpc: Generate auth cookie in hex instead of base64 (Wladimir J. van der Laan)
tags/v0.15.1
Wladimir J. van der Laan 5 년 전
부모
커밋
6f3ef551fa
No account linked to committer's email address
1개의 변경된 파일4개의 추가작업 그리고 3개의 파일을 삭제
  1. 4
    3
      src/rpc/protocol.cpp

+ 4
- 3
src/rpc/protocol.cpp 파일 보기

@@ -77,9 +77,10 @@ boost::filesystem::path GetAuthCookieFile()

bool GenerateAuthCookie(std::string *cookie_out)
{
unsigned char rand_pwd[32];
GetRandBytes(rand_pwd, 32);
std::string cookie = COOKIEAUTH_USER + ":" + EncodeBase64(&rand_pwd[0],32);
const size_t COOKIE_SIZE = 32;
unsigned char rand_pwd[COOKIE_SIZE];
GetRandBytes(rand_pwd, COOKIE_SIZE);
std::string cookie = COOKIEAUTH_USER + ":" + HexStr(rand_pwd, rand_pwd+COOKIE_SIZE);

/** the umask determines what permissions are used to create this file -
* these are set to 077 in init.cpp unless overridden with -sysperms.

Loading…
취소
저장