LibreOffice Module svl (master) 1
Static Public Member Functions | Static Private Member Functions | List of all members
SvPasswordHelper Class Reference

#include <PasswordHelper.hxx>

Static Public Member Functions

static SVL_DLLPUBLIC void GetHashPassword (css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
 
static SVL_DLLPUBLIC void GetHashPassword (css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
 
static SVL_DLLPUBLIC void GetHashPasswordSHA1UTF8 (css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
 
static SVL_DLLPUBLIC void GetHashPasswordSHA256 (css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
 
static SVL_DLLPUBLIC bool CompareHashPassword (const css::uno::Sequence< sal_Int8 > &rOldPassHash, std::u16string_view sNewPass)
 Use this method to compare a given string with another given Hash value. More...
 

Static Private Member Functions

static void GetHashPasswordLittleEndian (css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
 
static void GetHashPasswordBigEndian (css::uno::Sequence< sal_Int8 > &rPassHash, std::u16string_view sPass)
 

Detailed Description

Definition at line 31 of file PasswordHelper.hxx.

Member Function Documentation

◆ CompareHashPassword()

bool SvPasswordHelper::CompareHashPassword ( const css::uno::Sequence< sal_Int8 > &  rOldPassHash,
std::u16string_view  sNewPass 
)
static

Use this method to compare a given string with another given Hash value.

This is necessary, because in older versions exists different hashes of the same string. They were endian dependent. We need this to handle old files. This method will compare against big and little endian UTF-16. tdf#115483: also check 2 different new ways of hashing that were added in ODF 1.2, requiring UTF-8 encoding.

Definition at line 98 of file PasswordHelper.cxx.

References GetHashPasswordBigEndian(), GetHashPasswordLittleEndian(), GetHashPasswordSHA1UTF8(), and GetHashPasswordSHA256().

◆ GetHashPassword() [1/2]

static SVL_DLLPUBLIC void SvPasswordHelper::GetHashPassword ( css::uno::Sequence< sal_Int8 > &  rPassHash,
const char *  pPass,
sal_uInt32  nLen 
)
static

◆ GetHashPassword() [2/2]

static SVL_DLLPUBLIC void SvPasswordHelper::GetHashPassword ( css::uno::Sequence< sal_Int8 > &  rPassHash,
std::u16string_view  sPass 
)
static

◆ GetHashPasswordBigEndian()

void SvPasswordHelper::GetHashPasswordBigEndian ( css::uno::Sequence< sal_Int8 > &  rPassHash,
std::u16string_view  sPass 
)
staticprivate

Definition at line 77 of file PasswordHelper.cxx.

References ch, GetHashPassword(), and i.

Referenced by CompareHashPassword().

◆ GetHashPasswordLittleEndian()

void SvPasswordHelper::GetHashPasswordLittleEndian ( css::uno::Sequence< sal_Int8 > &  rPassHash,
std::u16string_view  sPass 
)
staticprivate

Definition at line 61 of file PasswordHelper.cxx.

References ch, GetHashPassword(), and i.

Referenced by CompareHashPassword().

◆ GetHashPasswordSHA1UTF8()

void SvPasswordHelper::GetHashPasswordSHA1UTF8 ( css::uno::Sequence< sal_Int8 > &  rPassHash,
std::u16string_view  sPass 
)
static

Definition at line 39 of file PasswordHelper.cxx.

References comphelper::Hash::calculateHash(), and OUStringToOString().

Referenced by CompareHashPassword().

◆ GetHashPasswordSHA256()

void SvPasswordHelper::GetHashPasswordSHA256 ( css::uno::Sequence< sal_Int8 > &  rPassHash,
std::u16string_view  sPass 
)
static

Definition at line 28 of file PasswordHelper.cxx.

References comphelper::Hash::calculateHash(), and OUStringToOString().

Referenced by CompareHashPassword().


The documentation for this class was generated from the following files: