mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2025-12-10 13:37:03 +03:00
move to new cspot
This commit is contained in:
@@ -1,35 +1,49 @@
|
||||
#ifndef LOGINBLOB_H
|
||||
#define LOGINBLOB_H
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <vector>
|
||||
|
||||
#include "ConstantParameters.h"
|
||||
#include "Crypto.h"
|
||||
|
||||
#include "protobuf/authentication.pb.h"
|
||||
|
||||
class LoginBlob
|
||||
{
|
||||
private:
|
||||
int blobSkipPosition = 0;
|
||||
std::unique_ptr<Crypto> crypto;
|
||||
namespace cspot {
|
||||
class LoginBlob {
|
||||
private:
|
||||
int blobSkipPosition = 0;
|
||||
std::unique_ptr<Crypto> crypto;
|
||||
std::string name, deviceId;
|
||||
|
||||
uint32_t readBlobInt(const std::vector<uint8_t>& loginData);
|
||||
std::vector<uint8_t> decodeBlob(const std::vector<uint8_t>& blob,
|
||||
const std::vector<uint8_t>& sharedKey);
|
||||
std::vector<uint8_t> decodeBlobSecondary(const std::vector<uint8_t>& blob,
|
||||
const std::string& username,
|
||||
const std::string& deviceId);
|
||||
|
||||
uint32_t readBlobInt(const std::vector<uint8_t>& loginData);
|
||||
std::vector<uint8_t> decodeBlob(const std::vector<uint8_t>& blob, const std::vector<uint8_t>& sharedKey);
|
||||
std::vector<uint8_t> decodeBlobSecondary(const std::vector<uint8_t>& blob, const std::string& username, const std::string& deviceId);
|
||||
public:
|
||||
LoginBlob(std::string name);
|
||||
std::vector<uint8_t> authData;
|
||||
std::string username = "";
|
||||
int authType;
|
||||
|
||||
public:
|
||||
LoginBlob();
|
||||
std::vector<uint8_t> authData;
|
||||
std::string username;
|
||||
int authType;
|
||||
// Loading
|
||||
void loadZeroconfQuery(std::map<std::string, std::string>& queryParams);
|
||||
void loadZeroconf(const std::vector<uint8_t>& blob,
|
||||
const std::vector<uint8_t>& sharedKey,
|
||||
const std::string& deviceId, const std::string& username);
|
||||
void loadUserPass(const std::string& username, const std::string& password);
|
||||
void loadJson(const std::string& json);
|
||||
|
||||
// Loading
|
||||
void loadZeroconf(const std::vector<uint8_t>& blob, const std::vector<uint8_t>& sharedKey, const std::string& deviceId, const std::string& username);
|
||||
void loadUserPass(const std::string& username, const std::string& password);
|
||||
void loadJson(const std::string& json);
|
||||
std::string buildZeroconfInfo();
|
||||
std::string getDeviceId();
|
||||
std::string getDeviceName();
|
||||
std::string getUserName();
|
||||
|
||||
std::string toJson();
|
||||
std::string toJson();
|
||||
};
|
||||
|
||||
#endif
|
||||
} // namespace cspot
|
||||
Reference in New Issue
Block a user