Solved

Lsa secrets

Posted on 2002-03-23
2
782 Views
Last Modified: 2013-12-03
I am storing a password as a LSA secret using LsaStorePrivateData using a hardcoded key string. I am able to get the password using LsaRetrievePrivateData. The point is I have a feature in my app that can be optionally password protected. So if the user removes the password protection I want to delete the password from the LSA database. The next time when I query the LSA database with the same key string I will get an error and I know it is not password protected. I can store another secret to check whether it is password protected but it is a kludge.

P.S. My app has admin privileges. It is a COM server launched under Administrator identity
0
Comment
Question by:vbk_bgm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 32

Accepted Solution

by:
jhance earned 100 total points
ID: 6891426
Did you read the SDK docs?

Under the PARAMETERS section for LasStorePrivateData see:

PrivateData
Pointer to an LSA_UNICODE_STRING structure containing the private data to store. The function encrypts this data before storing it.
If this parameter is NULL, the function deletes any private data stored under the key and deletes the key. Subsequent attempts to retrieve data from the key will return the STATUS_OBJECT_NAME_NOT_FOUND error code.


As it says, to DELETE the data (as I think you are asking... your question is somewhat unclear) you store it with a NULL in the PrivateData parameter.
0
 
LVL 2

Author Comment

by:vbk_bgm
ID: 6891956
Yeah that works! I will read the SDK docs carefully hereon.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article shows how to make a Windows 7 gadget that accepts files dropped from the Windows Explorer.  It also illustrates how to give your gadget a non-rectangular shape and how to add some nifty visual effects to text displayed in a your gadget.…
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question