Diff
Not logged in

Differences From:

File src/user.c part of check-in [916b6e4b3b] - Improvements to web-based user management. by drh on 2007-07-21 19:32:06. [view]

To:

File src/user.c part of check-in [e621b6dbe3] - Use POST instead of GET for the /xfer method. Other bug fixes in the URL parser. by drh on 2007-07-30 14:28:17. [view]

@@ -55,10 +55,10 @@
   strip_string(pPassphrase, z);
 }
 
 /*
-** Prompt the user for a passphrase used to encrypt the private key
-** portion of an RSA key pair.
+** Prompt the user for a password.  Store the result in the pPassphrase
+** blob.
 **
 ** Behavior is controlled by the verify parameter:
 **
 **     0     Just ask once.
@@ -67,9 +67,13 @@
 **           verification.  Repeat if the two strings do not match.
 **
 **     2     Ask twice, repeat if the strings do not match.
 */
-static void get_passphrase(const char *zPrompt, Blob *pPassphrase, int verify){
+void prompt_for_password(
+  const char *zPrompt,
+  Blob *pPassphrase,
+  int verify
+){
   Blob secondTry;
   blob_zero(pPassphrase);
   blob_zero(&secondTry);
   while(1){
@@ -118,9 +122,9 @@
     Blob passwd, login, contact;
 
     prompt_user("login: ", &login);
     prompt_user("contact-info: ", &contact);
-    get_passphrase("password: ", &passwd, 1);
+    prompt_for_password("password: ", &passwd, 1);
     db_multi_exec(
       "INSERT INTO user(login,pw,cap,info)"
       "VALUES(%B,%B,'jnor',%B)",
       &login, &passwd, &contact
@@ -150,9 +154,9 @@
     if( uid==0 ){
       fossil_fatal("no such user: %s", g.argv[3]);
     }
     zPrompt = mprintf("new passwd for %s: ", g.argv[3]);
-    get_passphrase(zPrompt, &pw, 1);
+    prompt_for_password(zPrompt, &pw, 1);
     if( blob_size(&pw)==0 ){
       printf("password unchanged\n");
     }else{
       db_multi_exec("UPDATE user SET pw=%B WHERE uid=%d", &pw, uid);