CryptoPassphrase  Diff

Differences From Artifact [06f1c18e56]:

To Artifact [ad9c1f261f]:


80
81
82
83
84
85
86
87

88
89
90
91
92
93
94
95
96
97
98
99
100
101
102

103
104
105
106
107

108
109
110
111
112
113
114
115
116
117

118
119
120
121
122
123
124
125
126
127

128
129
130
131
132
133
134
135
136
137
138
139
140
141
142

143
144
145
146
147
148
149
80
81
82
83
84
85
86

87
88
89
90
91
92
93
94
95
96
97
98
99
100
101

102
103
104
105
106

107
108
109
110
111
112
113
114
115
116

117
118
119
120
121
122
123
124
125
126

127
128
129
130
131
132
133
134
135
136
137
138
139
140
141

142
143
144
145
146
147
148
149







-
+














-
+




-
+









-
+









-
+














-
+







	[_path release];
	[_storage release];
	[_sites release];

	[super dealloc];
}

- (OFArray*)sites
- (OFArray<OFString *> *)sites
{
	void *pool = objc_autoreleasePoolPush();
	OFArray *sites = [[_storage allKeys] sortedArray];

	[sites retain];
	objc_autoreleasePoolPop(pool);
	return [sites autorelease];
}

- (size_t)sitesCount
{
	return [_storage count];
}

- (bool)hasSite: (OFString*)name
- (bool)hasSite: (OFString *)name
{
	return (_storage[name] != nil);
}

- (size_t)lengthForSite: (OFString*)name
- (size_t)lengthForSite: (OFString *)name
{
	OFDictionary *site = _storage[name];

	if (site == nil)
		@throw [OFInvalidArgumentException exception];

	return [site[lengthField] sizeValue];
}

- (bool)isSiteLegacy: (OFString*)name
- (bool)isSiteLegacy: (OFString *)name
{
	OFDictionary *site = _storage[name];

	if (site == nil)
		@throw [OFInvalidArgumentException exception];

	return [site[legacyField] boolValue];
}

- (void)setSite: (OFString*)site
- (void)setSite: (OFString *)site
	 length: (size_t)length
	 legacy: (bool)legacy
{
	void *pool = objc_autoreleasePoolPush();

	_storage[site] = @{
		lengthField: @(length),
		legacyField: @(legacy)
	};
	[self _update];

	objc_autoreleasePoolPop(pool);
}

- (void)removeSite: (OFString*)name
- (void)removeSite: (OFString *)name
{
	[_storage removeObjectForKey: name];
	[self _update];
}

- (void)_update
{