File tree 2 files changed +11
-2
lines changed
src/encryption/NServiceBus.Encryption
tests/encryption/NServiceBus.Encryption.Tests
2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ void EncryptObject(object target)
35
35
continue ;
36
36
}
37
37
38
- if ( property . PropertyType . IsPrimitive )
38
+ if ( property . PropertyType . IsPrimitive || IsSystemType ( property . PropertyType ) )
39
39
continue ;
40
40
41
41
//recurse
@@ -94,14 +94,21 @@ void DecryptObject(object target)
94
94
continue ;
95
95
}
96
96
97
- if ( property . PropertyType . IsPrimitive )
97
+ if ( property . PropertyType . IsPrimitive || IsSystemType ( property . PropertyType ) )
98
98
continue ;
99
99
100
100
//recurse
101
101
DecryptObject ( property . GetValue ( target , null ) ) ;
102
102
}
103
103
}
104
104
105
+ bool IsSystemType ( Type propertyType )
106
+ {
107
+ var nameOfContainingAssembly = propertyType . Assembly . FullName . ToLower ( ) ;
108
+
109
+ return nameOfContainingAssembly . StartsWith ( "mscorlib" ) || nameOfContainingAssembly . StartsWith ( "system.core" ) ;
110
+ }
111
+
105
112
void DecryptProperty ( object target , PropertyInfo property )
106
113
{
107
114
Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ public class SecureMessage:IMessage
153
153
public MySecretSubProperty SubProperty { get ; set ; }
154
154
155
155
public WireEncryptedString SecretThatIsNull { get ; set ; }
156
+
157
+ public DateTime DateTime { get ; set ; }
156
158
}
157
159
158
160
You can’t perform that action at this time.
0 commit comments