~ubuntu-branches/ubuntu/trusty/keepass2/trusty-proposed

« back to all changes in this revision

Viewing changes to KeePassLib/Cryptography/PasswordGenerator/PwProfile.cs

  • Committer: Package Import Robot
  • Author(s): Julian Taylor
  • Date: 2011-12-30 15:45:59 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20111230154559-3en1b9v90hswvs1w
Tags: 2.18+dfsg-1
* New upstream release
  - refresh patches
  - drop upstream applied patches:
    explicitly-PUT-for-webdav-writes.patch
    prefer-4.0-framework-if-available.patch
* add patch to improve autotype when dealing with multiple keyboard layouts
  - Thanks to amiryal for the patch
* disable initial autoupdate popup via patch
* update years in debian/copyright

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
  KeePass Password Safe - The Open-Source Password Manager
3
 
  Copyright (C) 2003-2011 Dominik Reichl <dominik.reichl@t-online.de>
 
3
  Copyright (C) 2003-2012 Dominik Reichl <dominik.reichl@t-online.de>
4
4
 
5
5
  This program is free software; you can redistribute it and/or modify
6
6
  it under the terms of the GNU General Public License as published by
21
21
using System.Collections.Generic;
22
22
using System.Text;
23
23
using System.Xml.Serialization;
 
24
using System.ComponentModel;
24
25
using System.Diagnostics;
25
26
 
26
27
using KeePassLib.Interfaces;
55
56
        public sealed class PwProfile : IDeepCloneable<PwProfile>
56
57
        {
57
58
                private string m_strName = string.Empty;
 
59
                [DefaultValue("")]
58
60
                public string Name
59
61
                {
60
62
                        get { return m_strName; }
69
71
                }
70
72
 
71
73
                private bool m_bUserEntropy = false;
 
74
                [DefaultValue(false)]
72
75
                public bool CollectUserEntropy
73
76
                {
74
77
                        get { return m_bUserEntropy; }
96
99
                }
97
100
 
98
101
                private string m_strCharSetRanges = string.Empty;
 
102
                [DefaultValue("")]
99
103
                public string CharSetRanges
100
104
                {
101
105
                        get { this.UpdateCharSet(true); return m_strCharSetRanges; }
108
112
                }
109
113
 
110
114
                private string m_strCharSetAdditional = string.Empty;
 
115
                [DefaultValue("")]
111
116
                public string CharSetAdditional
112
117
                {
113
118
                        get { this.UpdateCharSet(true); return m_strCharSetAdditional; }
120
125
                }
121
126
 
122
127
                private string m_strPattern = string.Empty;
 
128
                [DefaultValue("")]
123
129
                public string Pattern
124
130
                {
125
131
                        get { return m_strPattern; }
127
133
                }
128
134
 
129
135
                private bool m_bPatternPermute = false;
 
136
                [DefaultValue(false)]
130
137
                public bool PatternPermutePassword
131
138
                {
132
139
                        get { return m_bPatternPermute; }
134
141
                }
135
142
 
136
143
                private bool m_bNoLookAlike = false;
 
144
                [DefaultValue(false)]
137
145
                public bool ExcludeLookAlike
138
146
                {
139
147
                        get { return m_bNoLookAlike; }
141
149
                }
142
150
 
143
151
                private bool m_bNoRepeat = false;
 
152
                [DefaultValue(false)]
144
153
                public bool NoRepeatingCharacters
145
154
                {
146
155
                        get { return m_bNoRepeat; }
148
157
                }
149
158
 
150
159
                private string m_strExclude = string.Empty;
 
160
                [DefaultValue("")]
151
161
                public string ExcludeCharacters
152
162
                {
153
163
                        get { return m_strExclude; }
159
169
                }
160
170
 
161
171
                private string m_strCustomID = string.Empty;
 
172
                [DefaultValue("")]
162
173
                public string CustomAlgorithmUuid
163
174
                {
164
175
                        get { return m_strCustomID; }
170
181
                }
171
182
 
172
183
                private string m_strCustomOpt = string.Empty;
 
184
                [DefaultValue("")]
173
185
                public string CustomAlgorithmOptions
174
186
                {
175
187
                        get { return m_strCustomOpt; }
227
239
                        PwProfile pp = new PwProfile();
228
240
                        Debug.Assert(psPassword != null); if(psPassword == null) return pp;
229
241
 
230
 
                        byte[] pbUTF8 = psPassword.ReadUtf8();
231
 
                        char[] vChars = StrUtil.Utf8.GetChars(pbUTF8);
 
242
                        byte[] pbUtf8 = psPassword.ReadUtf8();
 
243
                        char[] vChars = StrUtil.Utf8.GetChars(pbUtf8);
232
244
 
233
245
                        pp.GeneratorType = PasswordGeneratorType.CharSet;
234
246
                        pp.Length = (uint)vChars.Length;
253
265
                        }
254
266
 
255
267
                        Array.Clear(vChars, 0, vChars.Length);
256
 
                        Array.Clear(pbUTF8, 0, pbUTF8.Length);
 
268
                        MemUtil.ZeroByteArray(pbUtf8);
257
269
                        return pp;
258
270
                }
259
271